Mike,
Thanks for the input. However, that is exactly what I am doing now, and I
do (now) care about the sequence of requests. That is why I was thinking of
using the Queue class to hold requests. The main part I'm having trouble
with is in another thread processing those requests in the Queue and letting
the thread that added the request to the queue know that its request has
been fulfilled. And, also how to make the Queue processing thread 'sleep'
until the Queue.count is > 0.
As an aside... I was wondering if you know the difference between using
SyncLock/End SyncLock and Monitor.Enter/Monitor.Exit?
Thanks again for any input!
Norm
"Michael D. Ober" <obermd.@.alum.mit.edu.nospam> wrote in message
news:St***************@newsread3.news.pas.earthlin k.net...
Do you care about the order the requests are handled? If not, put your
network handler in a module (class or regular) and then use the following
code around your "critical section"
static SyncObj as new Object
Synclock SyncObj
' Process Critical Section
End SyncLock
Note that SyncObj is static as it must stick around for the life of the
application. What this does is stops all threads and forces them to wait
until the previous thread is complete with the network IO.
Mike Ober.
"Justin" <justin23856 @ hotmail> wrote in message
news:e9**************@TK2MSFTNGP14.phx.gbl... I am having trouble figuring out the best what to accomplish this fairly
simple goal. I have a program that controls a 1-wire network and I can
only make requests to it one at a time, but I will need to make new requests
(from multiple threads) before the first one is done. My idea is to use
a
Queue to add requests to and then have another process (thread) that will
simply wait for the Queue to not be empty and then process requests one
at
a time until it is empty and then again wait for the Queue to not be empty.
I'm looking for a basic framework of what would be best way to do this
using what Classes and how to signal between threads (if needed?). I would use
Queue, Thread? and ??
Any help is appreciated.
Norm