Re: close() of active socket does not work on FreeBSD 6



On Wednesday 13 December 2006 04:49, Daniel Eischen wrote:
On Tue, 12 Dec 2006, Poul-Henning Kamp wrote:
In message <20061212160016.W56465@xxxxxxxxxxxxxxx>, Bruce Evans writes:
On Mon, 11 Dec 2006, Daniel Eischen wrote:

It's probably a nightmare in the kernel too. close() starts looking
like revoke(), and revoke() has large problems and bugs in this area.

There is the distinctive difference that revoke() operates on a name
and close() on a filedescriptor, but otherwise I agree.

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).

Stop using signal, it is slow for threaded process, first you don't
know which threads are using the descriptor, second, you have
to run long code path in kernel signal code to find and deliver
the signals to all interested threads, that is too expensive for
benchmark like apache benchmark.

David Xu


_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: close() of active socket does not work on FreeBSD 6
    ... It's probably a nightmare in the kernel too. ... like revoke(), and revokehas large problems and bugs in this area. ... Well, if threads waiting on IO are interruptable by signals, ... Even if you have implemented the closewith the interruption, ...
    (freebsd-arch)
  • Re: close() of active socket does not work on FreeBSD 6
    ... It's probably a nightmare in the kernel too. ... like revoke(), and revokehas large problems and bugs in this area. ... and all device drivers catch signals (oops, ...
    (freebsd-arch)
  • Re: close() of active socket does not work on FreeBSD 6
    ... It's probably a nightmare in the kernel too. ... like revoke(), and revokehas large problems and bugs in this area. ... and all device drivers catch signals (oops, ... way to cancel an infinite disk wait. ...
    (freebsd-arch)
  • Re: how do threads work?
    ... >> A process cannot consider to switch task unless the flow of instructions ... >> kernel for a little help, in the form of regular timer signals. ... If you now ask, how does the kernel deliver signals, then we are no longer ...
    (comp.os.linux.development.system)
  • Re: Comments on the KSE option
    ... think M:N support in the kernel is a good idea. ... When the userland thread library issues a non-blocking ... When the userland thread scheduler switches threads ... It must also poll for blocked signals. ...
    (freebsd-current)