multithreading

Status
This thread has been Locked and is not open to further replies. The original thread starter may use the Report button to request it be reopened but anyone else with a similar issue should start a New Thread. Watch our Welcome Guide to learn how to use this site.

Caliraj

Thread Starter
Joined
Mar 22, 2006
Messages
145
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
 
Joined
Jul 29, 2004
Messages
6,650
There's an excellent answer to your question on this page : Multithreading in Java .
Also, I advise you to bookmark this page because it contains a good description of how to create, use and synchronize threads. The rules described are pratically similar to multitasking.
Have a nice reading. ;)
 
Joined
Sep 12, 2003
Messages
20,583
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
 
Status
This thread has been Locked and is not open to further replies. The original thread starter may use the Report button to request it be reopened but anyone else with a similar issue should start a New Thread. Watch our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top