No not really. I'll be a bit more specific.
I have a thread running managing the serial port. I have another thread
running using the serial port thread.
When the serial port gets a specific number of bits it sets an event to let
the user thread know there is a data message in the buffer.
When the user thread wants to write data out the serial port it loads a
buffer with its data and sets an event to have the serial port write out the
data.
The reason for this is portability. I want do the same thing with ethernet
and usb.
The user thread works identically with thatever I/O port thread it is using.
I don't think this is a standard consumer-producer problem. But maybe I'm
wrong.
Thanks,
Bill
"Ashura" <As****@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com...
first of all, in ya typical consumer and producer situition, i dont think
firing events between each other sounds like a better idea (IMO).
CLASSIC implementation is:
producer notify comsumer buffer ready
-------------> consumer do some magic (buffer locked, producer
automatically suspended awaiting for lock release)
--------------------------> consumer finishes (lock released)
-------------------------------------->producer automaticlly restarted
hope this helps