• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Please Help me Out

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Though my intention was the same, but it was not expressed correctly.

Thanks for correcting Rahul.
 
reply
    Bookmark Topic Watch Topic
  • New Topic