Obtaining the "ps ax" pid from a thread?

From: Timur Tabi (nospam_timur_at_tabi.org)
Date: 03/26/04

  • Next message: Active8: "need guidance/suggestions setting up devel sys on Redhat 7.1"
    Date: 26 Mar 2004 13:48:16 -0800
    
    

    When I call pthread_create(), I get a new thread and a thread ID, TID.
     When I issue the "ps ax" command from the shell, I see a bunch of
    copies of my application, each with its own PID. The TID and PID are
    not the same, so I can't tell which entry from the "ps" command
    matches which thread I created.

    How can I obtain, in my threads, the numeric value displayed by "ps"?


  • Next message: Active8: "need guidance/suggestions setting up devel sys on Redhat 7.1"

    Relevant Pages

    • Re: 7.1RC1: system hang
      ... pid ppid pgrp uid state wmesg wchan cmd ... Tracing command vmstat pid 96381 tid 100276 td 0xc756caf0 ...
      (freebsd-stable)
    • Re: Wait for background processes to complete
      ... trying to use the shell concepts and maximize parallelism). ... the systemcommand - which leaves us back at square one. ... fork, and then do your own wait. ... PID PGID COMMAND ...
      (comp.lang.perl.misc)
    • Re: Lock Order Reversal on 7.0-STABLE with pf and ipfw / dummynet (traces)
      ... lock order reversal: ... Tracing pid 23 tid 100022 td 0xffffff00011bf340 ... Tracing command dhcpd pid 36121 tid 100080 td 0xffffff000146f680 ...
      (freebsd-stable)
    • Re: Complete process information
      ... ps eauwww {pid} While an exact Solaris equivalent ... > command line a process was started with. ... First is to check your shell. ...
      (comp.unix.solaris)
    • Re: lockfiles versus other synchronization mechanisms
      ... So my idea for a multiplex handler might be good idea then. ... thinking of three basic services issuable via shell commands. ... or pid of service in use ... The only caveat that I can see, is that the lock command would need to ...
      (comp.unix.programmer)