|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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. |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
Quote:
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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Delphi Programming > Trouble with thread and buffers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|