This is the mail archive of the java-discuss@sourceware.cygnus.com 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: Thread.interrupt()


Boehm, Hans wrote,
> The crucial problem with this is that at least every class in 
> the system that performs blocking I/O has to play by these 
> rules.

The same applies to Thread.interrupt().

Interrupts can be cleared or deferred indefinitely, so Thread.
interrupt() isn't a guaranteed way of cancelling a thread which
doesn't respect the protocol.

Much the same goes for the complaint that resource revocation
violates encapsulation: if it's unexpected an interrupt 
represents a pretty violent disruption of control flow.
Of course an interrupt isn't always unexpected, but then 
neither is resource revocation.

Cheers,


Miles

-- 
Miles Sabin                       Cromwell Media
Internet Systems Architect        5/6 Glenthorne Mews
+44 (0)20 8817 4030               London, W6 0LJ, England
msabin@cromwellmedia.com          http://www.cromwellmedia.com/

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