This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC, fix for bogus timeouts in select()


On Fri, 2004-10-22 at 11:17, Andrew Lunn wrote:
> > - non-blocking reads here...
> > - select() returns a timeout
> > - read() returns data, even though select() immediately preceding it
> > returned a timeout.
> 
> Since you are running on a pre-emptive multitasking OS, this is
> expected behaviour. 
> 
> To know if there is a real bug here, we need to know when the data was
> put into the socket relative to when select exited. Turning on tracing
> will probably show this.

So what I should look for is(i.e. a bug exists if):

1. select() sleeps
2. data arrives
3. thread on which select() executes is starved until after timeout
expires
4. select() wakes up after timeout has expired *and* data has arrived
5. select() returns a timeout instead of "data arrived"


I claim the above happens, but I have not provided evidence.

> 
>         Andrew
-- 
Øyvind Harboe
http://www.zylin.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]