Re: Linux: two processes read/write on single serial port
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Re: Linux: two processes read/write on single serial port




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: Linux: two processes read/write on single serial port  
Jens Thoms Toerring


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-17-07 12:16 PM

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





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:28 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register