My scenario is as follows:
I am implementing a server that must timeout or produce a response within the specified timeout period for each request. Thus each request is ensured a response from the server's point of view (the response, of course, might not reach the client due to transport layer failure, etc...).
In order to implement the above semantics, each request spawns a thread (actually retrieves an available one from a thread pool) and awaits its response via a notify on a sync object. The wait period is limited with a timeout param sent to Object's wait method. The spawned thread delegates the request to an object that actually knows how to handle the request. This object's call API is known, but there is no known service level agreement which would specify that a call will never hang indefinitely. (Specifically in my case, the Server is actually a CORBA client - but that is not the point.)
Now, what interests me, is whether or not there is a way for me to somehow detect that that thread is not responsive and then kill it (interrupt it) even though I am currently blocked on a method call?
By the way, I know that I can keep a reference to the thread object and after a pre-specified amount of time call its interrupt() method. That unfortunately does not ensure "interrupt" semantics...
Java Thread Primitive Deprecation
Thanks all