* [Xenomai-help] Best way to identify a Xenomai task
@ 2006-05-27 9:09 Jean-Olivier Villemure
2006-05-27 12:27 ` Gilles Chanteperdrix
0 siblings, 1 reply; 4+ messages in thread
From: Jean-Olivier Villemure @ 2006-05-27 9:09 UTC (permalink / raw)
To: xenomai
Hi,
I'm looking for the best to identify a Xenomai Task.
We are running multiple task inside kernel space and I need to identify
each of these task. Is there a sort of TaskID ? Otherwise I could look
at the address of the thread associated to one task, but is there a
better way?
Thank You!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Best way to identify a Xenomai task
2006-05-27 9:09 [Xenomai-help] Best way to identify a Xenomai task Jean-Olivier Villemure
@ 2006-05-27 12:27 ` Gilles Chanteperdrix
2006-05-28 18:23 ` Jean-Olivier Villemure
0 siblings, 1 reply; 4+ messages in thread
From: Gilles Chanteperdrix @ 2006-05-27 12:27 UTC (permalink / raw)
To: jean-olivier.villemure; +Cc: xenomai
Jean-Olivier Villemure wrote:
> Hi,
>
> I'm looking for the best to identify a Xenomai Task.
>
> We are running multiple task inside kernel space and I need to identify
> each of these task. Is there a sort of TaskID ? Otherwise I could look
> at the address of the thread associated to one task, but is there a
> better way?
It depends on the skin you are using,
- for posix skin, it is pthread_self()
- for native skin, it is rt_task_self()
- for vxworks skin, it is taskIdSelf()
The task Id of a new task is also returned by the task creation
services:
- pthread_create for the posix skin,
- rt_task_create for the native skin,
- taskSpawn for the vxworks skin.
When using taskInit with the vxworks skin, the task ID is the address of
the tcb passed as first argument.
--
Gilles Chanteperdrix.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Best way to identify a Xenomai task
2006-05-27 12:27 ` Gilles Chanteperdrix
@ 2006-05-28 18:23 ` Jean-Olivier Villemure
2006-05-28 18:51 ` Gilles Chanteperdrix
0 siblings, 1 reply; 4+ messages in thread
From: Jean-Olivier Villemure @ 2006-05-28 18:23 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
Gilles Chanteperdrix wrote:
> The task Id of a new task is also returned by the task creation
> services:
> - rt_task_create for the native skin
>
Thank you for your answer!
Looking at the API, i see that rt_task_create returns:
- 0 is returned upon success. Otherwise:
- ENOMEM is returned if the system fails to get enough dynamic memory
from the global real-time heap in order to create or register the task.
- EEXIST is returned if the /name/ is already in use by some registered
object.
- EPERM is returned if this service was called from an asynchronous context.
So according to this, no TaskId is returned by this function since 0 is
returned upon success. But according to the EEXIST error, can we
considerate that the name of the task is unique? So I could simply use
this information to identify my tasks ?
Thank you again :-)
Jean-Olivier
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Best way to identify a Xenomai task
2006-05-28 18:23 ` Jean-Olivier Villemure
@ 2006-05-28 18:51 ` Gilles Chanteperdrix
0 siblings, 0 replies; 4+ messages in thread
From: Gilles Chanteperdrix @ 2006-05-28 18:51 UTC (permalink / raw)
To: Jean-Olivier Villemure; +Cc: xenomai
Jean-Olivier Villemure wrote:
> Gilles Chanteperdrix wrote:
> > The task Id of a new task is also returned by the task creation
> > services:
> > - rt_task_create for the native skin
> >
> Thank you for your answer!
>
> Looking at the API, i see that rt_task_create returns:
> - 0 is returned upon success. Otherwise:
> - ENOMEM is returned if the system fails to get enough dynamic memory
> from the global real-time heap in order to create or register the task.
> - EEXIST is returned if the /name/ is already in use by some registered
> object.
> - EPERM is returned if this service was called from an asynchronous context.
>
> So according to this, no TaskId is returned by this function since 0 is
> returned upon success. But according to the EEXIST error, can we
> considerate that the name of the task is unique? So I could simply use
> this information to identify my tasks ?
Sorry, the task Id is not really returned by rt_task_create, the task Id
is the RT_TASK pointer passed as first argument.
--
Gilles Chanteperdrix.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-05-28 18:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-27 9:09 [Xenomai-help] Best way to identify a Xenomai task Jean-Olivier Villemure
2006-05-27 12:27 ` Gilles Chanteperdrix
2006-05-28 18:23 ` Jean-Olivier Villemure
2006-05-28 18:51 ` Gilles Chanteperdrix
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.