[lkml]   [2000]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] thread wakeup fix for 2.4.0-test7
In message <> you
> On Fri, 25 Aug 2000, Rusty Russell wrote:
> >
> > BUG: thread 1 is doing poll() on an fd, thread 2 closes it,
> > and thread 1 doesn't wake up. Included is a small test program and
> > Makefile.
> Why do you call this a bug?
> Thread 1 still has the fd open (it's used by the poll()).
> The fact that thread 2 removed it from the fd table is immaterial.

Your implementation disagrees with you: poll already returns POLLNVAL.
With the patch it just returns it immediately, rather than returning
it when/if it times out.

Single Unix Specification also disagrees with you:

The close() function will deallocate the file descriptor
indicated by fildes. To deallocate means to make the file
descriptor available for return by subsequent calls to open()
or other functions that allocate file descriptors.

So we could sleep in close (forever, maybe) until the polls are
finished if you prefer.

close doesn't close. This would be a ``bug'', Linus.

Hacking time.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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