Determining CPU thread is running on with IRIX 6.5? - SGI

This is a discussion on Determining CPU thread is running on with IRIX 6.5? - SGI ; Is it possible to determine which CPU a thread is running on by some system call? I'm trying to understand a 3rd party app that has over 100 threads in one process. I need to augment the code to tell ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Determining CPU thread is running on with IRIX 6.5?

  1. Determining CPU thread is running on with IRIX 6.5?

    Is it possible to determine which CPU a thread is running on by some
    system call?

    I'm trying to understand a 3rd party app that has over 100 threads in
    one process. I need to augment the code to tell me which processor a
    thread is executing on.

    Is this possible, and if so how?

    Thanks in advance.

    Les

  2. Re: Determining CPU thread is running on with IRIX 6.5?

    The thread you're interested in can call get_cpu() which is defined in
    . To find out the info for a different thread, you should open
    the proc entry for the process and do a PIOCTHREAD ioctl() on it with a
    sub-command of PIOCPSINFO. You'll end up with a struct prpsinfo which
    has a pr_sonproc element which will be the cpu that the thread was
    running on at the time that you made the call.
    Michael

    Les Hartzman wrote:
    >
    > Is it possible to determine which CPU a thread is running on by some
    > system call?
    >
    > I'm trying to understand a 3rd party app that has over 100 threads in
    > one process. I need to augment the code to tell me which processor a
    > thread is executing on.
    >
    > Is this possible, and if so how?
    >
    > Thanks in advance.
    >
    > Les


    --
    Michael A. Raymond Office: (651) 683-3434
    Core OS Group Real-Time System Software

+ Reply to Thread