Hi...
I want to use FIFO queue concept for PC serial port communication through PC com port for data transmission & reception.
Can anybody suggest me any good document available on net for this or any suggestion how i can use it in my application...
Thanks,
Vinay

Queue in c# for SerialPort communication...
Helen Cool Granny
The Queue class in .NET can be used for what you want. However without more information about what you want to enqueue I'm not sure what you'll do. Serial ports do not necessary send all the bytes of a request in a single packet so it is possible that you'll get multiple events for a single block of data you care about. A Queue might not be the best way to go here. However assuming that you build workable data from serial port requests and then want to enqueue the work data for later processing then after you get the data you'd enqueue the request on the queue. A separate thread would periodically run and remove each work item from the queue and process it. Thread safety is important here as two threads would be accessing the queue simultaneously. Even more important though is that you don't want to block the queue for any length of time. The serial port would lock the queue, push the data and unlock the queue. The data would have already been read by the port reader code. On the "listener" thread you'd lock the queue, remove all items from the queue (storing them in a local queue perhaps), release the queue and then process the queued items using a local queue. You'll need to deal with the case of data coming in after you've already unlocked the queue (either by enumerating until no more data exists or simply checking the queue frequently enough for it not to matter).
Hope this helps,
Michael Taylor - 11/7/06