All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] [BUG] normal pthreads broken
@ 2006-06-22 16:12 Jan Kiszka
  2006-06-23  8:50 ` Philippe Gerum
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2006-06-22 16:12 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai-core

[-- Attachment #1: Type: text/plain, Size: 547 bytes --]

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai-core] [BUG] normal pthreads broken
  2006-06-22 16:12 [Xenomai-core] [BUG] normal pthreads broken Jan Kiszka
@ 2006-06-23  8:50 ` Philippe Gerum
  2006-06-23  8:58   ` Philippe Gerum
  2006-06-23  9:07   ` Jan Kiszka
  0 siblings, 2 replies; 4+ messages in thread
From: Philippe Gerum @ 2006-06-23  8:50 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai-core

On Thu, 2006-06-22 at 18:12 +0200, Jan Kiszka wrote:
> 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.

> 
> #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
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
-- 
Philippe.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai-core] [BUG] normal pthreads broken
  2006-06-23  8:50 ` Philippe Gerum
@ 2006-06-23  8:58   ` Philippe Gerum
  2006-06-23  9:07   ` Jan Kiszka
  1 sibling, 0 replies; 4+ messages in thread
From: Philippe Gerum @ 2006-06-23  8:58 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai-core

On Fri, 2006-06-23 at 10:50 +0200, Philippe Gerum wrote:
> On Thu, 2006-06-22 at 18:12 +0200, Jan Kiszka wrote:
> > 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.

>  but tracing it a bit, the issue is indeed the
> same one.
> 
> > 
> > #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
> > Xenomai-core@domain.hid
> > https://mail.gna.org/listinfo/xenomai-core
-- 
Philippe.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai-core] [BUG] normal pthreads broken
  2006-06-23  8:50 ` Philippe Gerum
  2006-06-23  8:58   ` Philippe Gerum
@ 2006-06-23  9:07   ` Jan Kiszka
  1 sibling, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2006-06-23  9:07 UTC (permalink / raw)
  To: rpm; +Cc: xenomai-core

[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]

Philippe Gerum wrote:
> On Thu, 2006-06-22 at 18:12 +0200, Jan Kiszka wrote:
>> 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.

> 
>> #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
>> Xenomai-core@domain.hid
>> https://mail.gna.org/listinfo/xenomai-core



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-06-23  9:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-22 16:12 [Xenomai-core] [BUG] normal pthreads broken Jan Kiszka
2006-06-23  8:50 ` Philippe Gerum
2006-06-23  8:58   ` Philippe Gerum
2006-06-23  9:07   ` Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.