On Sat, Jun 07, 2036 at 07:48:37PM -0700, Joseph Shraibman wrote:
> Run the following with green threads and you get only H's. Run it with native
> threads and you get H's mixed with L's
The native threading mechanism on Linux doesn't offer many thread
priority choices (run "man pthread_attr_ini
I think you could rephrase that as "In Java, Thread priorities don't
work". :-) The language guarantees about thread priorities are probably
weaker than you expect. Quoth the language spec:
"Every thread has a priority. When there is competition for processing
resources, threads with higher prior
This is perfectly legal with respect to the JLS. LinuxThreads only
allows thread priorities for the scheduling policies SCHED_RR,
SCHED_FIFO, both policies would require superuser privileges and are
not what you really want to have for Java threads.
Joseph> Run the following with green thre
Thread priorities don't work in any JVM I've used. Java's rules are
fairly senseless, too.
I'm not sure your case qualifies as a bug, though:
> public void run(){
> //Thread.yield();
> while(true){
> System.out.print(name);
> System.out.flush
Run the following with green threads and you get only H's. Run it with native
threads and you get H's mixed with L's
/**
* threadtest.java
*
*
* Created: Mon May 1 15:35:45 2000
*
* @author Joseph Shraibman
* @version 1.0
*/
public class threadtest {
public threadtest() {}