[EMAIL PROTECTED] wrote:
> Gilles Chanteperdrix :
> >> But when I start my application I still get just Linux threads and no
> >> Xenomai
> >> shadow tasks are created. Can anybody give me a hint how I can controll
> >> what
> >> kind of thread is created ?>
>
> > Normally, any thread created with pthread_create has a
> > shadow. Whether they are started in primary mode depends on
> > their scheduling policy.
> >
>
> I think this was the hint I have been looking for.
> Now I set some attributes explicitly :
> nResult = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
> ASSERT(nResult == 0);
> nResult = pthread_attr_setschedpolicy(&attr, SCHED_FIFO);
> ASSERT(nResult == 0);
> (although this should be the default)
The default is SCHED_OTHER, for consistency with Linux native threading
libraries. Note however that even threads created with the SCHED_OTHER
policy are shadowed.
>
> But when I create a thread with
> nResult = pthread_create(&tid, &attr, (void *) & body, pTask);
> pthread_create returns with 4=Interrupted system call. Unfortunatelly this
> return value is not documented. Can you tell me what it means ?
Even worse, if you read the specification, you will see that
pthread_create should never return EINTR. A value of EINTR means that a
suspending call was interrupted by a signal. It may happen if you are
explicitely using signals, or alternatively when running under gdb,
because gdb itself uses signals.
>
> >
> > Could you try reducing your problem to a program as simple as
> > possible, and send us the sources of this program ?
>
> I´ll try this when I am not succesfull in starting threads with the changed
> attributes (see above).
>
> > How do
> > you know that no shadow threads are created ?
> >
>
> I had a look in /proc/xenomai/sched and couldn´t see any Xenomai-task. Isn´t
> this the usual way ?
Yes it is the usual way. The "main" thread is automatically shadowed
when the application is started, so, you should see at least one shadow.
--
Gilles Chanteperdrix.
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help