Multithreading Testing on Processors

rln's Avatar, Join Date: Oct 2007
rln
Go4Expert Member
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's Avatar, Join Date: Jul 2004
Go4Expert Founder
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's Avatar, Join Date: Oct 2007
rln
Go4Expert Member
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's Avatar, Join Date: Jul 2004
Go4Expert Founder
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's Avatar, Join Date: Oct 2007
Skilled contributor
I would love to have a core 2 duo but it seems to be too costly at the moment.
rln's Avatar, Join Date: Oct 2007
rln
Go4Expert Member
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's Avatar, Join Date: Jul 2004
Go4Expert Founder
2 process having an infinite loop would suggest that but I am not sure