Multithreaded Apps and the OS in relation to Dual Core CPU's

Status
Not open for further replies.

cyrusroe

Posts: 16   +0
I just wanna clear something up so tell me if I'm right.

I've heard that it is the OS that handles how processes are sent to the CPU, and so if you have a dual core cpu, the OS will tell the processes which core to go to so that things will be processed in parallel.

So, lets say I'm running nero and photoshop at the same time. So, if i was burning a CD it would be one thread of processes being sent to one of the cores by the OS, and then while editing stuff in photoshop it would be an entirely different single thread being sent to the other core by the OS.

Now, with a multithreaded app, the application is telling the OS to send two different threads that pertain to that program.

So I guess here are the main questions I want answered:

1. Is it true that a multithreaded app does not talk directly with the CPU? but rather, the app must first talk to the OS which then passes on the message to the CPU/cpu cores?

2. So then, the vast majority of programs that are provided to the consumer are single threaded? and so the OS will be able to run 2 programs at the same time with no lag because the OS realizes this and knows to send the processes for each app to a different core?

3. does this mean that the main difference between single and multithreaded apps is that they talk to the OS differently?

4. Does this mean that if you were to run 2 multithreaded apps on a dual core cpu, it would pretty much equate to the same things as 2 single threaded apps running on a single core cpu performance wise?

Thx for your help!
 
1) Applications do not talk to the CPU. Actually they are prohibited from doing it. Only the OS can use the lowest level CPU instructions. And actually there is not much an application would want to say to the CPU anyway.

2) Basically, yes. If we ignore the fact that in a modern OS you have dozens of threads active at any time (a 32-core CPU anyone?) and they manage to do it without any visible "lag" with a single CPU too.

3) The main difference is that a multithreadad application can be run in multiple threads simultaneously giving them the ability to take advantage of multiple processing units and offer a non-blocking interface. Yes, a multithreaded application will make different requests to the OS, namely requesting creation and destruction of the threads.

4) No. How can two single threaded applications on a single core CPU match the performance of any two applications running on almost twice the computing power (2 cores)?
 
Status
Not open for further replies.
Back