[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Microcom++
From:       Denis Vlasenko <vda.linux () googlemail ! com>
Date:       2008-01-29 9:45:00
Message-ID: 200801290945.00240.vda.linux () googlemail ! com
[Download RAW message or body]

On Monday 28 January 2008 10:09, Vladimir Dronnikov wrote:
> > About usleep(10) - why is it needed? Because if we ^X
> > fast enough, comm port is shut down too fast and last char(s)
> > are not xmitted?
> 
> Right you are!
> This delay is not needed unless we have piped input.
> When input is piped we almost never get a chance to see device output.

I don't understand. I thought kernel will block us
if we try to write too much data to serial port
(writing way faster than it can send bits).

Is this not the case? If so, we probably need to
check for buffer space availability with POLLOUT,
instead of blindly writing gobs of data.

In other words: we may need full-fledged, bidirectional
piping loop here with checks for input AND output
buffer availability. We already have a few - see e.g.
telnetd.

In any case, adding arbitrary delays is not a good design.
What if the delay is too small or too big for the particular
device?

> Will it work too if it is moved after 'done:' label,
> > so that this pause is done only once at exit?
> 
> No. See above.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic