lkml.org 
[lkml]   [2000]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] thread wakeup fix for 2.4.0-test7
Date
In message <Pine.LNX.4.10.10008251011290.9381-100000@penguin.transmeta.com> you
write:
> 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.

Rusty.
--
Hacking time.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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