08-11-2005 02:48 AM
08-11-2005 03:13 AM
08-11-2005 03:31 AM
re hi,
Thanks, but my problem is that my both While Loops don't succeed in receiveing messages , because my For loop is too speed.
TheGame
08-11-2005 05:08 AM
If you use 2 queues, one for each while loop, the loops will be able to catch ALL the messages the for loop places into the queue, regardless of how fast the for loop is. You also won't need any delay in the while loops because the timeout will help you with that. The problem is that if the for loop always runs faster than the while loops (let's say the for loop gets a piece of data every 1 second and the while loop takes 2 seconds to process that datat) you will get more data than you can handle and there is nothing you can do about that really.
Somehow I don't think that's the case.
Do you want to make the for loop stop and wait for the while loops?
Make the queue size 1 and the enqueue timeout infinite. That way the for loop will always have to wait until the while loops empty the queue.
Do you want the while loops to catch all the data?
Make the queue size infinite and the dequeue timeout infinite.
If this doesn't help you, you will have to post more details.