dcsimg
How to detect if a thread is blocked
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Victor_Rachels
Posted On:   Friday, January 18, 2002 03:26 PM

Is it possible to detect, externally to a running Thread, if that thread is currently in a blocked state. [ie, waiting on file IO]

ie, something similar to isInterrupted()



supplemental to this: Is it possible to extend Thread and override a function call that is made when a blocking operation is called. [ie, is there such a function]



This is in order to create a situation where the extended thread [or normal thread if there is a positive answer to the first question] can be used with no design changes by other programmers, as per a normal Thread object. [without requiring a enterBlock() blockOp() exitBlock() sequence]

Re: How to detect if a thread is blocked

Posted By:   Anonymous  
Posted On:   Saturday, January 19, 2002 03:40 PM

In the JDK 1.4, there will be new I/O Api's that solve this problem ...


Most of your questions will be answered at http://java.sun.com/j2se/1.4/docs/guide/nio/ ...


I don't think it's possible to find a decent workaround with the 'normal' IO api's ...



Regards,


G√ľnther.
http://www.javacoding.net

About | Sitemap | Contact