| Jens Thoms Toerring 2007-05-17, 7:16 am |
| Steven Woody <narkewoody@gmail.com> wrote:
> On May 17, 1:32 am, j...@toerring.de (Jens Thoms Toerring) wrote:
[vbcol=seagreen]
> actually, each process need both read and write. what process A read
> comes from what process B write, and what process A write becomes what
> process B read.
That's going to be "interesting", not because of a problem with
both processes opening the serial port in read/write mode, but
because you have to figure out a way to keep the processes from
reading what they just have written. If you for example would
have A write something to the port for B to receive and then
immediately would have A start to read, expecting an answer from
B, then that could easily fail with A reading what it just had
send because B hadn't had a chance to read it yet. You will need
some additional communication channel that A and B use to syn-
chronize their read accesses. For example A could send a signal
to B when it has finished reading a complete message from B with
B waiting for that signal before starting to try to read again,
and the same the other way round.
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
|