Multithreading Testing on Processors

Discussion in 'MFC' started by rln, Oct 18, 2007.

  1. rln

    rln New Member

    Joined:
    Oct 12, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    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.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    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.
     
  3. rln

    rln New Member

    Joined:
    Oct 12, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    why I Need 2 processes.?
    Because I need to testing the multi threading (whethther 2 threads simultaneously running )in a process.

    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.
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    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.
     
  5. Izaan

    Izaan New Member

    Joined:
    Oct 16, 2007
    Messages:
    215
    Likes Received:
    2
    Trophy Points:
    0
    I would love to have a core 2 duo but it seems to be too costly at the moment.
     
  6. rln

    rln New Member

    Joined:
    Oct 12, 2007
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    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) ?
     
  7. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    2 process having an infinite loop would suggest that but I am not sure
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice