This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: RFC, fix for bogus timeouts in select()
- From: Øyvind Harboe <oyvind dot harboe at zylin dot com>
- To: Andrew Lunn <andrew at lunn dot ch>
- Cc: ecos-patches at sources dot redhat dot com
- Date: Fri, 22 Oct 2004 11:02:09 +0200
- Subject: Re: RFC, fix for bogus timeouts in select()
- References: <1098362231.21934.21.camel@famine> <20041022084410.GP2141@lunn.ch>
On Fri, 2004-10-22 at 10:44, Andrew Lunn wrote:
> Hi Oyvind
>
> Did you debug this in detail. I don't see why your fix should help.
> The only thing i could come up with is if selwait.wait() is returning
> 0 when both the condition variable is true and a timeout has
> happened. But looking at the condition variable code i cannot see how
> that would happen.
The patch I wrote is broken.
I see that I've only caused confusion by attempting to formulate a patch
before the issue had been discussed and I properly understood the
select.cxx code. Sorry.
The important thing is to decide whether the current behaviour of
select() is the desired behaviour.
> Can you explain in detail what is happening and why your fix works for
> you?
This is how I discovered the issue:
- non-blocking reads here...
- select() returns a timeout
- read() returns data, even though select() immediately preceding it
returned a timeout.
>
> Thanks
> Andrew
--
Øyvind Harboe
http://www.zylin.com