[3377] in java-interest

home help back first fref pref prev next nref lref last post

Thread.interrupt() ? How to timeout a thread?

daemon@ATHENA.MIT.EDU (Bob Beck)
Thu Nov 9 21:00:35 1995

Date: Thu, 9 Nov 95 13:34 PST
To: java-interest@java.sun.com
From: Bob Beck <rbk@ibeam.jf.intel.com>

I was working with some code that does URL.openStream().  Looks like if this
can get to the host of the URL, it then insists on reading from it.  I have
cases where it gets to the host, but the socket read never returns (blocked
forever in java.net.SocketInputStream.read()).  So, I thought I'd try having
a timeout, where some other thread sends the blocked thread an interrupt().
A test program proved that Thread.interrrupt() (and various others) aren't
implemented (the methods are there, but they throw NoSuchMethodError).  Any
idea when these will be there?  In the interum, how can I get a thread to
stop what it's doing, when it's blocked in someone elses code?  I had hoped
I could interrupt() it, catch this in an exception handler...

BTW: this is with Beta1.0 on WinNT.
--
Bob Beck                rbk@ibeam.intel.com     CompuServe: 71674,106
Intel Corporation       (503)264-8856           AOL: RDBeck

-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post