[235] in java-interest
Re: Threads vs New White Paper
daemon@ATHENA.MIT.EDU (Peter Korp)
Thu Jun 8 10:06:42 1995
From: Peter Korp <korp@athens.dis.anl.gov>
Date: Thu, 8 Jun 1995 08:51:14 -0500
To: java-interest@java.Eng.Sun.COM
> Note that as Jon pointed out, threads of the same priority currently
> don't preemt each other. This may change in the future.
[...]
As I am currently writing a good deal of VisualWorks Smalltalk code and Java
code let me also throw my vote in as wanting this to change.
VisualWorks has the same view of threads as proposed above. Higher priority
threads starving lower priority threads. So even though we have locks etc...
certain pieces of code become a nightmare to write with "Processor yield"
thrown in or delays just to let another thread get a chance to execute.
> Absence of yield()'s in your code will not interfere with the operation
> of the browser since the UI code runs at a higher priority than the
> typical Applet thread, but other Applets may be starved. If you have
> a long calculation you can either yield, or you can run it at a lower
> priority to prevent starving Applets that are merely performing
> interaction calculations.
Of course by running at a lower priority *your* thread now takes the risk of
being starved! While I agree that these types of threads are useful, it is
much easier to write true multi-threaded code than that provided by
VisualWorks or Java.
If we can, lets do it right.
Peter
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com