Re: close() of active socket does not work on FreeBSD 6
- From: Daniel Eischen <deischen@xxxxxxxxxxx>
- Date: Wed, 13 Dec 2006 09:23:23 -0500 (EST)
[CC trimmed]
On Wed, 13 Dec 2006, David Xu wrote:
On Wednesday 13 December 2006 04:49, Daniel Eischen wrote:
Well, if threads waiting on IO are interruptable by signals,
can't we make a new signal that's only used by the kernel
and send it to all threads waiting on IO for that descriptor?
When it gets out to actually setup the signal handler, it
just resumes like it is returning from an SA_RESTART signal
handler (which according to another posting would reissue
the IO command and get EBADF).
Even if you have implemented the close() with the interruption, another
thread openning a file still can reuse the file handle immediately,
according to specifications, the lowest free file handle will be returned,
if SA_RESTART is used, the interrupted thread restart the syscall,
it will be using a wrong file, I think even if we have implemented the
feature in kernel, useland threads still has serious race to fix.
If you use a special signal that is only used for this
purpose, there is no reason you have to try the IO operation
again. You can just return EBADF.
Anyway, this was just a thought/idea. I don't mean to
argue against any of the other reasons why this isn't
a good idea.
--
DE
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: close() of active socket does not work on FreeBSD 6
- From: Robert Watson
- Re: close() of active socket does not work on FreeBSD 6
- References:
- Re: close() of active socket does not work on FreeBSD 6
- From: Poul-Henning Kamp
- Re: close() of active socket does not work on FreeBSD 6
- From: Daniel Eischen
- Re: close() of active socket does not work on FreeBSD 6
- From: David Xu
- Re: close() of active socket does not work on FreeBSD 6
- Prev by Date: Re: close() of active socket does not work on FreeBSD 6
- Next by Date: Re: Where do MSI quirks belong? [patch]
- Previous by thread: Re: close() of active socket does not work on FreeBSD 6
- Next by thread: Re: close() of active socket does not work on FreeBSD 6
- Index(es):
Relevant Pages
|
|