[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread.stop, suspend and resume deprecation in 1.2

Dear Oyvind,

> Thread.stop, Thread.suspend and Thread.resume will
> be deprecated in 1.2
> I believe the CSP libraries that have been written
> at the moment depend on them at a very few places.

The JCSP library uses them in only one place:


This is a component that allows you to spawn a CSProcess network and
start/stop/suspend/resume/join it concurrently with the process that
did the spawning.

Its use is primarilly for the implementation of:


The reason ActiveApplet uses them is to get a trivial way of implementing
an applet's stop, suspend and resume methods (which are called as you
switch away from or back to pages containing applets).  An ActiveApplet
runs a user defined network of CSProcesses (i.e. a ProcessNetwork) and
needs to be able to suspend/resume its whole network at any time.

Without the use of Thread.suspend etc., process networks that were going
to be used efficiently in applets would need to be equipped with pause
and (graceful!) reset channels ... which would complicate their design
just for the sake of the applet context in which they were going to be

The same difficulty applies to ordinary applets (i.e. java.applet.Applet)
that have multiple threads within them.  So what do JDK 1.2 uses do there?
If you have the JDK 1.2 documentation, what does it tell you to use
instead of  Thread.suspend etc.?

Ah ... I've just remembered that we don't actually use Thread.suspend at
all ... we use ThreadGroup.suspend etc.  Have these ThreadGroup methods
been deprecated in 1.2?