• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multithreading,tasking

 
eswar kumar
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the difference among MultiThreading,MultiProcessing,MultiTasking?
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Multiprocessing means that there are more than one process (program or executeable) running in the OS and if in terms of programming, then some interprocess communication or cooperation is taking place.
Multitasking and Multiprocessing mean essentially the same thing. Multitasking is when several processes share the same CPU by each taking a slice of time either pre-emptively (the OS decides) or cooperatively (the process decides).
Multithreading means that a single process (program) has more than one thread of execution.
In both schemes it is important to protect data from corruption by concurrent access from different threads/processes. In a Java multithreaded application we protect the data by using the synchronized key word or an object monitor. For multiprocess applications it is necessary to use kernel level objects like semaphores and mutexes to keep the data protected.
 
Igor Ko
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes,and each task/process works in its own memory space, and
can't access to other process memory space. (really if you have
enough privilege, and works in corresponding OS you can do it,
using some very special system calls).
Thread works in the same address (memory) space as other threads
in the same application/process/task. So it can change the memory
for other threads. And because processor shouldn't switch memory
context, the switching from thread to thread is faster, than
process to process.
[ December 22, 2003: Message edited by: Igor Ko ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic