This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please Help me Out

 
Pratap Pandey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There was a question asked to me in one of my interview (although its not about a code snippet or some logic) and i want to share it with you all.

Which one is better Multiprocessing or Multithreading ? and why?


please explain me.
 
Shoumin Li
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not easy to tell which is better,they are not the same concept:
MultiProcessing refers to a computer system's ability to support more than one process (program) at the same time. Multiprocessing operating systems enable several programs to run concurrently. UNIX is one of the most widely used multiprocessing systems, but there are many others, including OS/2 for high-end PCs. Multiprocessing systems are much more complicated than single-process systems because the operating system must allocate resources to competing processes in a reasonable manner.
Multithreading means the ability of an operating system to execute different parts of a program, called threads, simultaneously. The programmer must carefully design the program in such a way that all the threads can run at the same time without interfering with each other.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not really sure that it still makes sense to use the term multiprocessing, because every OS does that these days. You can test that by writing a simple program that does nothing but print numbers to the console. Open two consoles, start the program in both, and you'll see that they are both progressing.

Are you sure the question wasn't about multi-processor systems?
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm not really sure that it still makes sense to use the term multiprocessing, because every OS does that these days. You can test that by writing a simple program that does nothing but print numbers to the console. Open two consoles, start the program in both, and you'll see that they are both progressing.


Thats a good answer Ulf. Of course, though almost all the processors are designed in the same way, i think the terms are still existing atleast for the sake of differentiation. Aint I?
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Raghavan Muthu:
though almost all the processors are designed in the same way,


Please correct me if I am wrong.
Operating system level multiprocessing is achieved by operation system's scheduler, nothing to do with the processor.

The microprocessor sees it just like sequential execution of instructions.Multiprocessing is achieved by time slicing , that is done by the OS scheduler.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Though my intention was the same, but it was not expressed correctly.

Thanks for correcting Rahul.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic