[223] in java-interest

home help back first fref pref prev next nref lref last post

Re: Threads vs New White Paper

daemon@ATHENA.MIT.EDU (John Mitchell)
Wed Jun 7 20:06:05 1995

From: johnm@medicus.com (John Mitchell)
To: jpayne@starwave.com
Date: Wed, 7 Jun 95 16:58:30 PDT
Cc: java-interest@java.Eng.Sun.COM
In-Reply-To: <9506072202.AA09830@flim.starwave.com>; from "Jonathan Payne" at Jun 7, 95 3:02 pm

> Java threads are preemptive in that if a threads a priority 5 is
> currently running and then a thread at priority 6 wants to run, the
> first thread is preempted.

Assuming that the underlying thread package supports preemption.


> But if you have two threads both at priority 5, then the one which is
> running continues to run until it blocks, and then the other one gets
> a chance.

I.e., some sort of round robin within each priority level?


> On the other hand, the exact semantics do depend on the particular
> implementation.  For instance, in green threads, which are what's used
> on solaris, I believe the following is true:
> 
> 	Thread A is running at priority 5
> 	Thread B wants to run at priority 5.
> 	Thread C wants to run at priority 6.
> 	Thread C starts running, and then blocks.
> 	Thread B starts running.
> 
> In other words, when a high priority thread preempts a lower one, then
> that lower priority thread is moved to the end of the queue of threads
> at that priority.
> 
> God knows what happens on the NT version.

So, my question becomes: what then is the *real* specification of the
thread support in Java?  I.e., if I as a developer cannot count on
preemptive threading then I end up having to explicitly do all of that
yield() calling crap.  That's no better than not having thread support
in the language.

Thanks,
	John
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post