• 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
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Multiprocessing and multithreading

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
What is the difference b/n Multiprocessing and multithreading
Bye
Vinay
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A thread is a sequential flow of control through a program. Multi-threaded programming is, thus, a form of parallel programming where several threads of control are executing concurrently in the program. All threads execute in the same memory space, and can therefore work concurrently on shared data.
Multi-threaded programming differs from using multiple processes in that all threads share the same memory space (and a few other system resources, such as file descriptors), instead of running in their own memory space as is the case with processes.

Found on the net from various sources...
David.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David,
How can two simultaneous processes share data between them, in a typical desktop computer? TA
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's an important distinction to maintain among the terms multi-processing, parallel processing, and concurrent processing.
Parallel processing is true super-computer stuff, where multiple CPUs share the load of a single process by breaking it down and executing its code at the same time.
Multi-processing allows for concurrent, not simultaneous, processing. In this case, different processes can be assigned for execution to different CPUs. This can result in overall reductions in the cost of scheduling processes. Whereas parallel processing starts with each CPU or CPU group having its own system bus to work with, in multi-processing there's a common system bus (i.e., bottleneck). So the idea of MP is you can get much of what parallel processing offers, but for far less cost.
These are hardware-based strategies. Multi-threading, by contrast, is software-based. Using threads, it's possible to utilize CPU resources more efficiently. If one part of a program must wait on the results of a system interrupt, for example, another part of the program, say a calculation, could still run, rather than block on the pending interrupt. Multi-threaded programs therefore take advantage of time the CPU might otherwise simply be idling. Strictly speaking, a well-designed multi-threaded program will use resources more efficiently, the end result being that the overall time required for execution is less.
-----------------
Michael Ernest, co-author of:
The Complete Java 2 Certification Study Guide
[This message has been edited by Michael Ernest (edited December 29, 2000).]
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Could you explain, as much as possible, exactly how much of a resource saving threads can contribute to? It seems to me that even if threads are running in the same memory space, as one thread yields to another, some unique details about that thread will have to be saved. What, usually, are these details? In contrast what additional parameters are there for processes?
 
Thanks tiny ad, for helping me escape the terrible comfort of this chair.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic