lkml.org 
[lkml]   [1998]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: can select with infinite timeout return 0
On Wed, Aug 05, 1998 at 07:41:46PM -0700, Tristan Savatier wrote:

> We observed that select sometimes returns 0 even though
> a NULL pointer is passed for the timeout.
>
> According to the man page and all our books, select returns
> 0 only if no fd is ready when the timeout expires.
> Consequently if should never return 0 if a NULL pointer is
> passed for the timeout (infinite timeout).

select returns when either the timeout is reached, a filedescriptor
becomes readable or writable, or _when a signal interrupts it_. You're
using a multithreading package (pthreads, I'm assuming, although even
linuxthreads uses signals to communicate between threads if I'm not
mistaken) which delivers signals to other threads to force context
switches. That's why it only happens during multithreading. What you can
do is check errno for EINTR and repeat the select call if necessary.

Incidentally, I like mpegtv. Keep up the good work. :)

--
Andy Sloane
andude@guildsoftware.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.075 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site