I'm studying thread priorities and I have both windows 10 and Ubuntu 16.0 lts operating system.
And I got to know that windows doesn't provide priority based processing so that I can't see the use of priority based thread programs that how it is actually work .
So I run my priority based program in ubuntu because someone told me that ubuntu provide priority based process.
but when i run my program it show the same output or mixed output as windows.
So is there any way to enable priority in ubuntu ,we can enable priority in windows but for that I should have genuine windows which i haven't.
class MyThread extends Threads {
public void run() {
for(int i=0;i<20;i++)
System.out.println(Thread.currentThread().getName()+""+i);
}
}
class TestThread {
public static void main(String[] arg){
Thread.currentThread().setPriority(1);
MyThread t1=new MyThread();
t1.setPriority(10);
t1.start();
for(int i=0;i<20;i++)
system.out.println(Thread.currentThread().getName()+""+i);
}
}