The best thing to use for this Producer/Consumer pattern would be to use the Monitor Wait and Pulse methods. The thread that should read issues a Wait and the producer thread (putting things on the queue issues a Pulse when something is available. Then the Waiting thread wakes up and reads the queue. Unfortunately these methods aren't available on the CF. So in that case, assuming your application thread is a windows forms based application, use the Control.Invoke method to marshal a call to the UI thread for it to read the queue.
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
Hi
I need a replace for postmessage.
Sometimes I would like to notify the Application thread of some action. For
example, one thread is reading buffers from a socket, pushing them on a
queue list and I need to notify the main thread that he can start poping
buffers from this queue.
in Win32 I would just use a simple PostMessage where Msg > WM_USER. How
can I do the same in .Net. I should work on the CF to.
kind regards
Alexander