Author Michael.Felt
Recipients Michael.Felt, eryksun, jaketesler, pitrou, vstinner
Date 2019-05-22.15:56:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <09ff0a4c-d188-cec2-8311-96a44f4a03be@felt.demon.nl>
In-reply-to <1558530943.16.0.0640979847228.issue36084@roundup.psfhosted.org>
Content
On 22/05/2019 15:15, Jake Tesler wrote:
> Jake Tesler <jake.tesler@gmail.com> added the comment:
>
> I will look into whether adding thread_self() for AIX would be simple enough for this PR.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue36084>
> _______________________________________
>
Blush. Maybe I should have read further (to chapter T)

Here is a bare bones example - showing the pthread_self() is not the
right value, but thread_self is.

michael@x071:[/data/prj/aixtools/tests/posix]cat thread*.c
#include <pthread.h>
#include <sys/thread.h>
#include <stdio.h>

main()
{
        pid_t pid;
        tid_t tid;
        pthread_t ptid;

        pid = getpid();
        tid = thread_self();
        ptid = pthread_self();

        fprintf(stderr,"thread_self: pid:%d tid:%d ptid:%d\n", pid, tid,
ptid);
        sleep(300);     /* give time to run ps -mo THREAD */
}

michael@x071:[/data/prj/aixtools/tests/posix]./thread_self
thread_self: pid:*4129010 *tid:*23724099 *ptid:1

michael@x071:[/data/prj/aixtools/tests/posix]ps -mo THREAD
    USER     PID    PPID       TID S  CP PRI SC    WCHAN        F     TT
BND COMMAND
 michael 3408006 7012502         - A   3  61  1        -   200001 
pts/0  -1 ps -mo THREAD
       -       -       -  22282455 R   3  61  1        -   400000     
-  -1 -
 michael *4129010 *7012502         - A   0  60  1 f1000a03e16533b0 
8200011  pts/0  -1 ./thread_self
       -       -       -  *23724099 *S   0  60  1 f1000a03e16533b0  
410400      -  -1 -
History
Date User Action Args
2019-05-22 15:56:48Michael.Feltsetrecipients: + Michael.Felt, pitrou, vstinner, eryksun, jaketesler
2019-05-22 15:56:48Michael.Feltlinkissue36084 messages
2019-05-22 15:56:48Michael.Feltcreate