Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MFC (http://www.go4expert.com/forums/mfc/)
-   -   Multithreading Testing on Processors (http://www.go4expert.com/forums/multithreading-testing-processors-t6907/)

rln 18Oct2007 12:25

Multithreading Testing on Processors
 
Hi !
I need to test the thread execution processors in user mode.

Normal Processor - Execute One Thread at a time
Normal Processor + With HyperThreading Enabled (2 Logical Core Present) - Execute Two Threads at a time.
Dual Core Processor - (two Physical Core present) - Execute Two Threads at a time.


Assume One program is running two threads.

Is is possible to see visually or any proof of concept two thread is simultaneously running like that.

How to test these aspects with respect to C/C++/Win32 /etc ...programming?
I think using timestamp is not possible to test the multithreading. because
it is faster we can't print microsecond or even nanoseconds...etc...
Please advice me regarding this.

shabbir 18Oct2007 20:38

Re: Multithreading Testing on Processors
 
You should be having 2 processes and not 2 threads to be testing that. I am not sure if 2 threads will help because its only one thread that can be executed at a time and time is sliced between threads.

rln 19Oct2007 11:11

Re: Multithreading Testing on Processors
 
why I Need 2 processes.?
Because I need to testing the multi threading (whethther 2 threads simultaneously running )in a process.

Quote:

its only one thread that can be executed at a time and time is sliced between threads.
Only one thread executed at a time is with respect to normal processor.
I m asking this situation in Multicore processor like dual core,quad core etc..
Intel is tell 2 threads is running simultaneous. you can check their demo on their website.

shabbir 19Oct2007 17:06

Re: Multithreading Testing on Processors
 
As far as My understanding goes it should be 2 threads from 2 different processes and not from the same process because everything could be in a mess.

Think of the situation where both of my thread can run for the same processes then my function need to be re-entrant which means that my same function can be executed at the same time. What probably Intel has told is from marketing point of view where more than one thread can be run but I am yet to be convinced that it can be from the same processes.

Izaan 20Oct2007 11:25

Re: Multithreading Testing on Processors
 
I would love to have a core 2 duo but it seems to be too costly at the moment.

rln 22Oct2007 11:14

Re: Multithreading Testing on Processors
 
Quote:

Originally Posted by shabbir
As far as My understanding goes it should be 2 threads from 2 different processes and not from the same process because everything could be in a mess.

Think of the situation where both of my thread can run for the same processes then my function need to be re-entrant which means that my same function can be executed at the same time. What probably Intel has told is from marketing point of view where more than one thread can be run but I am yet to be convinced that it can be from the same processes.

fine Shabbir. Yes It may correct with respect to overall system processes.
In Dual Core processor 2 threads will run simultaneously not from same processes. It may from different process. I agree your points.

Is there any way to identify two threads are running simultaneouly (proof of concept) ?

shabbir 22Oct2007 17:17

Re: Multithreading Testing on Processors
 
2 process having an infinite loop would suggest that but I am not sure


All times are GMT +5.5. The time now is 05:19.