Skip to contentSkip to conversation

normal pthreads broken

Xenomai-core Jan Kiszka 2 participants 4 messages Jun 22, 2006 – Jun 23, 2006

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi Gilles,

I think some regression slipped into the rt-pthread lib. This example no longer works on my box (thread is not executed):

#include <pthread.h>
#include <stdio.h>
#include <sys/mman.h>

void *thread(void *arg)

{
        printf("thread\n");
        return 0;
}

main()

{
        pthread_t thr;

        mlockall(MCL_CURRENT|MCL_FUTURE);

        printf("create = %d\n",
               pthread_create(&thr, NULL, thread, NULL));
        pause();
}

This also explains why the cyclic test is broken.

Jan

#1 lore raw
Quoted 4 lines · Jan Kiszka

Hi Gilles,

I think some regression slipped into the rt-pthread lib. This example no longer works on my box (thread is not executed):

The issue is in src/skins/posix/thread.c. The trampoline does not even attempt to fire the thread body for policy == SCHED_OTHER. Will fix. This said, I still wonder why cyclic is affected, since it should only create SCHED_FIFO threads, but tracing it a bit, the issue is indeed the same one.

Quoted 31 lines

#include <pthread.h>
#include <stdio.h>
#include <sys/mman.h>

void *thread(void *arg)

{
        printf("thread\n");
        return 0;
}

main()

{
        pthread_t thr;

        mlockall(MCL_CURRENT|MCL_FUTURE);

        printf("create = %d\n",
               pthread_create(&thr, NULL, thread, NULL));
        pause();
}

This also explains why the cyclic test is broken.

Jan

_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core

Signature · 1 line
Philippe.
#2 lore raw
Quoted 10 lines · Philippe Gerum
Quoted 4 lines · Jan Kiszka

Hi Gilles,

I think some regression slipped into the rt-pthread lib. This example no longer works on my box (thread is not executed):

The issue is in src/skins/posix/thread.c. The trampoline does not even attempt to fire the thread body for policy == SCHED_OTHER. Will fix. This said, I still wonder why cyclic is affected, since it should only create SCHED_FIFO threads,

Oops, wrong. It first creates normal threads, then calls setschedparam to move them to the FIFO policy. So that's ok.

Quoted 34 lines

but tracing it a bit, the issue is indeed the
same one.

Quoted 31 lines

#include <pthread.h>
#include <stdio.h>
#include <sys/mman.h>

void *thread(void *arg)

{
        printf("thread\n");
        return 0;
}

main()

{
        pthread_t thr;

        mlockall(MCL_CURRENT|MCL_FUTURE);

        printf("create = %d\n",
               pthread_create(&thr, NULL, thread, NULL));
        pause();
}

This also explains why the cyclic test is broken.

Jan

_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core

Signature · 1 line
Philippe.
author
#3 lore raw
In reply to Philippe Gerum
Quoted 11 lines · Philippe Gerum
Quoted 4 lines · Jan Kiszka

Hi Gilles,

I think some regression slipped into the rt-pthread lib. This example no longer works on my box (thread is not executed):

The issue is in src/skins/posix/thread.c. The trampoline does not even attempt to fire the thread body for policy == SCHED_OTHER. Will fix. This said, I still wonder why cyclic is affected, since it should only create SCHED_FIFO threads, but tracing it a bit, the issue is indeed the same one.

It creates normal threads and then calls ppthread_setschedparam.

Quoted 31 lines
Quoted 31 lines

#include <pthread.h>
#include <stdio.h>
#include <sys/mman.h>

void *thread(void *arg)

{
        printf("thread\n");
        return 0;
}

main()

{
        pthread_t thr;

        mlockall(MCL_CURRENT|MCL_FUTURE);

        printf("create = %d\n",
               pthread_create(&thr, NULL, thread, NULL));
        pause();
}

This also explains why the cyclic test is broken.

Jan

_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core