bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: term & user space console


From: Marcus Brinkmann
Subject: Re: term & user space console
Date: Thu, 31 Jan 2002 15:53:33 +0100
User-agent: Mutt/1.3.27i

On Thu, Jan 31, 2002 at 01:03:33AM -0800, Thomas Bushnell, BSG wrote:
> A race should always be avoided if it makes a bug.  But there may be a
> way to avoid it without select.

Well, the only other idea I have beside io_select would be to have another
look just around the io_write that can be used to synchronize all
pending_output_size operations with potentially blocking writes.  Which
means that a pending_output_size could block for a long time (just not on
the global lock).  Not too sexy in my eyes.  So we should declare it as a
non-bug ;)

> pending_output_size is always approximate.  Users cannot rely on it
> being totally synchronized.  The situation you describe here occurs
> for almost all serial hardware in existence, and it's not a reason to
> worry about anything else.  So this case is a sort of race, but it's
> not a bug, because we don't actually need to worry about the exact
> value. 

Ok.  Now, you avoided to answer what is the better approximation in case
the underlying file supports tiocoutq.  npending_output,  the queue_size
returned by tiocoutq, or the sum of both?

> > Now, after the signature, an excerpt from the current implementation of the
> > writer loop.  What do you think?
> 
> Looks reasonable to me.  I assume that this function is the only one
> that mucks with the pending_output array?

Yes.  The only variable in it that needs to be a static global is
npending_output, output_stopped and hurdio_writer_condition (IIRC).

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
Marcus Brinkmann              GNU    http://www.gnu.org    marcus@gnu.org
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de



reply via email to

[Prev in Thread] Current Thread [Next in Thread]