Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 28th, 2004, 12:41 PM
Domisedon's Avatar
Domisedon Domisedon is offline
My beer is empty....
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: South Africa
Posts: 66 Domisedon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 20 sec
Reputation Power: 7
Trouble with thread and buffers

Hi

I've got a server receiving data from a serial port and a tcp/ip connection. Both are written as a server with another thread picking the data from them:

Processing Thread
| |
DataCommunication Thread
+ TCP Server
+ TCP Client
+ TCP Client
+ Serial Server
+ Serial Client
+ Serial Client

Both the serial client and the tcp client has their own FIFO buffers (Currently I use TStringList - suggestions welcome). The Serial server also has a FIFO picking the items from the Serial Client FIFO. Likewise the TCP Server has a FIFO picking the items from the TCP Client FIFO.

Then the DataCommunication has a FIFO picking the FIFO's of the Serial and TCP Servers.

I then have another thread picking the data from the DataCommunication thread, and processing it.

One of these FIFO's doesn't update correctly. I've got seperate counters in each FIFO and they update correctly. The processing thread processes at a rate of 50% of that the data is received. (eg. I receive 1200 records but I process 600 in that period of time). I've checked and the process thread takes the records off the buffer as fast as it is available.

I'm trying to process about 1200 records per second.

Any ideas would be appreciated.

Reply With Quote
  #2  
Old October 31st, 2004, 11:31 AM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Click here for more information.
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,713 Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 11 h 21 m 11 sec
Reputation Power: 1179
Hard to help you out without seeing any code mate.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month

Reply With Quote
  #3  
Old November 1st, 2004, 02:03 AM
Domisedon's Avatar
Domisedon Domisedon is offline
My beer is empty....
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: South Africa
Posts: 66 Domisedon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 20 sec
Reputation Power: 7
Quote:
Originally Posted by Scorpions4ever
Hard to help you out without seeing any code mate.


I know but I don't know how to give you access to 3000 lines of code...

It seems that we have found the problem and got it solved.

One of the threads had a sleep of 1 second, and only took one record out of the buffer at each execute - which got us to transfer 1 record through the system in a second instead of the 1200 we received. This was fixed.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Trouble with thread and buffers


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT