Unblocking blocked I/O

David Vrabel dv207@hermes.cam.ac.uk
Wed Sep 19 07:30:00 GMT 2001


On 2001年9月18日, David Vrabel wrote:
> I have a thread which blocks while reading from a network Socket. I need
> to unblock the thread so it can see it's supposed to die (and then die
> gracefully).

The java script in Sun's jdk 1.3.1 has this to say:
 "# bug #4344135 workaround
 # A thread currently waiting on a I/O operation will not wake up if one
 # of the files involved is actually closed (last close - the file is
 # no longer accessible but the thread is still waiting in the kernel).
 # The library libpreemptive_close.so is dynamically linked to the JVM"
Is this helpful? I'm guessing that libpreemtive_close.so provides
replacement read() and close() etc. Perhaps (really wild guess) the
replacement read() sets a flag when entered (and unsets it on exit) and
the close() signals the thread if the flag is set? This would unblock the
read() right?
David Vrabel


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /