Not sure if this thread belongs here, but anyways.
This guy, who was my Java tutor, claimed that the way Windows manages processes is sub par relative to Linux's multithreading.I didn't ask him for more explanation and as such he didn't go into details, but claimed that the processes in Windows are in fact threads that belong to one mother process and that is why-to his belief- Windows programs are subject to crashes that may bring the whole OS down.He said in Linux it is real multithreading and processing.
He reminded me of those Windows Media Player hangs when a crappy CD is inserted into the drive that often lead to most of the OS functions turning 'unresponsive'.Or IE lockups for that matter.
Funny thing though, is that I tried to reproduce the same problem in Kubuntu with Amarok 2 and it was even worse in another respect: When the cd was ejected, Amarok remained unresponsive forever so I had to close it manually.
That's in contrast with WMP where it resumes functioning as soon as the malformed CD is out the drive.
Also Vista doesn't seem to suffer from such issues.
Although, in a try to prove his point, he told me and my classmates to run this java code in both OS'es."This code should expose the faulty multithreading system of Windows."That's what the tutor claimed.
Here's the code:
//The Main class that execute the thread objects.
public class Main{
public static void main(String args[]){
Thread Tping=new Thread(new Ping());
Thread Tpong=new Thread(new Pong());
Tping.start();
Tpong.start();
try{
Tping.sleep(1000);
Tpong.sleep(1000);
}catch(InterruptedException e){
System.out.println("Exception occurred!");
}
}
}
//The Ping class, one of the threads.
public class Ping implements Runnable{
public void run(){
while(true){
System.out.print("Ping");
}
}
}
//The other thread, Pong.
public class Pong implements Runnable{
public void run(){
while(true){
System.out.print("Pong");
}
}
}
Try running this program in both Linux and Windows.I did it a while back, and I think the fault that the guy was suggesting came up when I moved the console winow or clicked in it ;The constant flux of "ping pong" was interrupted, that is the 'ping' suddenly shown up in the flow of 'pong' or vice versa.
In Linux, I didn't notice such phenomena, but I can't be sure.
So try it for yourself and see what comes out.
In any case, does it prove his point of a faulty multithreading in Windows?
Question
Aquarian
Not sure if this thread belongs here, but anyways.
This guy, who was my Java tutor, claimed that the way Windows manages processes is sub par relative to Linux's multithreading.I didn't ask him for more explanation and as such he didn't go into details, but claimed that the processes in Windows are in fact threads that belong to one mother process and that is why-to his belief- Windows programs are subject to crashes that may bring the whole OS down.He said in Linux it is real multithreading and processing.
He reminded me of those Windows Media Player hangs when a crappy CD is inserted into the drive that often lead to most of the OS functions turning 'unresponsive'.Or IE lockups for that matter.
Funny thing though, is that I tried to reproduce the same problem in Kubuntu with Amarok 2 and it was even worse in another respect: When the cd was ejected, Amarok remained unresponsive forever so I had to close it manually.
That's in contrast with WMP where it resumes functioning as soon as the malformed CD is out the drive.
Also Vista doesn't seem to suffer from such issues.
Although, in a try to prove his point, he told me and my classmates to run this java code in both OS'es."This code should expose the faulty multithreading system of Windows."That's what the tutor claimed.
Here's the code:
//The Main class that execute the thread objects. public class Main{ public static void main(String args[]){ Thread Tping=new Thread(new Ping()); Thread Tpong=new Thread(new Pong()); Tping.start(); Tpong.start(); try{ Tping.sleep(1000); Tpong.sleep(1000); }catch(InterruptedException e){ System.out.println("Exception occurred!"); } } } //The Ping class, one of the threads. public class Ping implements Runnable{ public void run(){ while(true){ System.out.print("Ping"); } } } //The other thread, Pong. public class Pong implements Runnable{ public void run(){ while(true){ System.out.print("Pong"); } } }Try running this program in both Linux and Windows.I did it a while back, and I think the fault that the guy was suggesting came up when I moved the console winow or clicked in it ;The constant flux of "ping pong" was interrupted, that is the 'ping' suddenly shown up in the flow of 'pong' or vice versa.
In Linux, I didn't notice such phenomena, but I can't be sure.
So try it for yourself and see what comes out.
In any case, does it prove his point of a faulty multithreading in Windows?
edit- corrected the code mistake.
Edited by AquarianLink to comment
Share on other sites
45 answers to this question
Recommended Posts