[kaffe] Question about priorities

Dalibor Topic robilad at kaffe.org
Thu Jun 10 11:42:02 PDT 2004


Hallo Alexander,

Alexander Boettcher wrote:
> Hi,
> 
> is somewhere defined how many priorities a JVM has to provide. I didn't 
> find something about it in the Java spec.

Check out 
http://java.sun.com/j2se/1.5.0/docs/guide/vm/thread-priorities.html for 
details and 
http://java.sun.com/docs/books/tutorial/essential/threads/priority.html 
for basics.

> I'm porting Kaffe to our DROPS (http://wwwos.inf.tu-dresden.de/drops) 
> and now is the question, whether Kaffe has to use/provide exactly 10 
> priorities or whether more than 10 priorities are possible.

You can have more, if you want to, but the API spec for 1.4.2 defines 10 
as max and 1 as min. So you'd have to change the values of these final 
fields in your port, if you intend to support more than 10 priority levels.

Not that priority level requests are not guaranteed to have any effect, 
so a VM may provide no different priority levels of it may provide 10.

Given that the JDK API specifies the API limits as 1 and 10, I guess 
that for binary compatibility reasons you may want to stay with 10 
levels of priority.

cheers,
dalibor topic




More information about the kaffe mailing list