Thanks for that Rob.  It does raise a couple of other issues, which I guess
wouldn't have been clear from my previous email.

A message that gets received or transmitted will involve a form of
acknowledgement to be sent/received, and therefore a writer thread would also
need to read and v.v.  I'm sure this could still be managed by careful
mutexing of the device, but does this imply that both threads will require a
callback on the readable fileevent. I'm not sure whether this is even
possible (looking at the fileevent man-page) or thread-safe (*if* its even
possible)?

Also, what issues are there regarding the sharing of a file descriptor
between two threads.  I seem to remember there were some problems using the
"detach" command, and digging back even further in my memory, I believe you
had suggested some solutions to this problem in the past.

Cheers,
Pete.

--
Peter Harper
[EMAIL PROTECTED]
http://www.open-msg.com/
--

On Wednesday 18 April 2001 11:22, you wrote:
> > Can someone give me some pointers/solution please?
>
> Use two threads to manage the device.
>
> One thread simply reads from the device.  Every time it gets a message,
> it puts it on the I-queue and broadcasts the I-queue Ns_Cond.
>
> The other thread simply waits on the O-queue cond.  Every time it gets
> signalled, it looks for messages on the O-queue and writes them to the
> device.

Reply via email to