Thread: Multithreading
View Single Post
  #5  
Old 07-28-01, 05:23 PM
pcres pcres is offline
Registered User
 
Join Date: Jun 2001
Location: California
Posts: 23
pcres is off the scale
Default Re: Multithreading != Multiprocessing

Quote:
Originally posted by Cutriss
It instead *facilitates* multiprocessing. If each of your apps is singly-threaded, then the OS can just arbitrate each of those threads to a processor as necessary. By breaking up the code into smaller chunks, the processor (singly or multiple) can more easily perform out-of-order execution and optimization routines to simplify the task at hand. Furthermore, it's an easier way to allocate resources. If you've got one processor that's 20% idle and another thread that would take 30% of its resources, then that processor wouldn't be able to easily handle the thread.

Basically, breaking up code into smaller fragments allows it to be more easily managed. Of course, there is a limit to how much this can be done before the ends no longer justify the means.


I agree with this, somewhat...

Multithreading has to do with breaking up a program so it can be run separatly in different threads, but the core has to be run in ONE thread, that is the case of MySQL, SQL server and Oracle... You can run multiple queries in multiple threads, but the core still has to be run in one single thread...

Now, if you compare the Linux version of MySQL or Oracle to to the Win version you will see that the help files (DLL's and such) are also running in the same thread as the core in the Win example, but in the Linux example, the core is run in one thread and the rest of it is run in the threads that have the least load, they can even exchange loads if necessary...

MP will increase performance somewhat in a NT environment, but it will almost double it in a Linux environment, now you know why...

Patrick
__________________
No question is to dumb if you are prepared for a technical answer...
Reply With Quote