Caliraj said:
Hi,
Could anyone let me know what exactly is the difference b/w Multithreading and Multitasking?What are the circumstance when one creates a thread by implementing a runnable interface as opposed to creating a sub class of teh Thread class.
Thanks,
Cali
Hi Caliraj,
Basically, in multitasking OSes and parellel programming language environments, if a problem can be divided into separably executable components that do not interfere with each other (i.e. no dependencies) that can be run in parallel, one or more new subprocesses are spawned to handle the load - i.e. the orginal process is the parent and the new subprocesses are children processes (i.e. having the same executable image as the parent, but unique to each subprocess is a private data area for saving items like registers such that the typical suspend/resume primitives can operate without the other processes stomping all over the registers like what would happen if the registers were saved in non-protected memory - a resume would cause a memory violation due to the register values that were save would get stomped on.
Multithreading, on the other hand, creates one or more threads which are considered lightweight processes - i.e. don't have all the features of a full process, but can be scheduled and executed quickly from a pool of available threads.
Either one is usually supported by libraries that implement the features unique to one or the other from either an OS library or a parallel programming language library.
Personally, I don't see the value in implementing a subclass of threads, because if a feature is not implemented that is needed it will not be available.
-- Tom