This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Unblocking blocked I/O


On Tue, 18 Sep 2001, 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]