* [Xenomai-help] xenoami task pids
@ 2006-03-14 21:50 Moser, Dan
2006-03-14 22:30 ` Jan Kiszka
2006-03-15 13:29 ` Philippe Gerum
0 siblings, 2 replies; 4+ messages in thread
From: Moser, Dan @ 2006-03-14 21:50 UTC (permalink / raw)
To: xenomai
Hi,
I am a Linux and Xenomai newbie.
I have two separate Xenomai 2.1-rc4 environments, one I built with
Gentoo running under VMware (WindowsXP Host) and another (that somebody
else built sometime in the recent past) with Gentoo running native on a
PC.
I have identical code (and Makefile) that simply executes an
rt_task_create(), rt_task_set_periodic(), and rt_task_start() and runs
(seemingly) proper on both boxes.
But:
On one box, the main thread and the Xenomai task thread have DIFFERENT
pids (reported via a call to getpid()). On the other box, the main
thread and the Xenomai task thread have the SAME pid (again, reported
via a call to getpid()).
Is there some sort of Xenomai and/or application config/build option
that controls this behavior?
Thanks in advance,
Dan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] xenoami task pids
2006-03-14 21:50 [Xenomai-help] xenoami task pids Moser, Dan
@ 2006-03-14 22:30 ` Jan Kiszka
2006-03-15 13:29 ` Philippe Gerum
1 sibling, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2006-03-14 22:30 UTC (permalink / raw)
To: Moser, Dan; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 1469 bytes --]
Moser, Dan wrote:
> Hi,
>
> I am a Linux and Xenomai newbie.
>
> I have two separate Xenomai 2.1-rc4 environments, one I built with
> Gentoo running under VMware (WindowsXP Host) and another (that somebody
> else built sometime in the recent past) with Gentoo running native on a
> PC.
>
> I have identical code (and Makefile) that simply executes an
> rt_task_create(), rt_task_set_periodic(), and rt_task_start() and runs
> (seemingly) proper on both boxes.
>
> But:
>
> On one box, the main thread and the Xenomai task thread have DIFFERENT
> pids (reported via a call to getpid()). On the other box, the main
> thread and the Xenomai task thread have the SAME pid (again, reported
> via a call to getpid()).
getpid = get process id, not thread id (there is pthread_self() for this).
My blind guess is that you are running linux_threads on the one machine
and NPTL threads on the other. Those are the libraries providing POSIX
thread support to the application, and this is also what Xenomai uses as
platform for its RT-threads. The first (older) library maps threads on
light-weight processes, the latter (NPTL) on real threads. Thus you get
a new id in the first and the same id in the second case. Again, just a
guess, I never stumbled over this behaviour consciously.
>
> Is there some sort of Xenomai and/or application config/build option
> that controls this behavior?
>
> Thanks in advance,
> Dan
>
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] xenoami task pids
2006-03-14 21:50 [Xenomai-help] xenoami task pids Moser, Dan
2006-03-14 22:30 ` Jan Kiszka
@ 2006-03-15 13:29 ` Philippe Gerum
1 sibling, 0 replies; 4+ messages in thread
From: Philippe Gerum @ 2006-03-15 13:29 UTC (permalink / raw)
To: Moser, Dan; +Cc: xenomai
Moser, Dan wrote:
> Hi,
>
> I am a Linux and Xenomai newbie.
>
> I have two separate Xenomai 2.1-rc4 environments, one I built with
> Gentoo running under VMware (WindowsXP Host) and another (that somebody
> else built sometime in the recent past) with Gentoo running native on a
> PC.
>
> I have identical code (and Makefile) that simply executes an
> rt_task_create(), rt_task_set_periodic(), and rt_task_start() and runs
> (seemingly) proper on both boxes.
>
> But:
>
> On one box, the main thread and the Xenomai task thread have DIFFERENT
> pids (reported via a call to getpid()). On the other box, the main
> thread and the Xenomai task thread have the SAME pid (again, reported
> via a call to getpid()).
>
> Is there some sort of Xenomai and/or application config/build option
> that controls this behavior?
Looks like one box uses an old glibc with LinuxThreads support (multiple pids are
visible from the application, one for each created thread including the main one),
and the other one a more recent NPTL-based pthread support (getpid() returns a
single "main" pid per process, although the NTPL still enforces a 1:1 mapping
between user-space and kernel threads that support them). This is not a Xenomai
issue in fact, but rather a glibc one, given that Xenomai relies on the glibc to
create user-space threads before promoting them to the real-time domain it controls.
Reading this may help:
http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/cins_nptl.html
>
> Thanks in advance,
> Dan
>
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
>
--
Philippe.
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [Xenomai-help] xenoami task pids
@ 2006-03-16 13:47 Moser, Dan
0 siblings, 0 replies; 4+ messages in thread
From: Moser, Dan @ 2006-03-16 13:47 UTC (permalink / raw)
To: xenomai
> Looks like one box uses an old glibc with LinuxThreads
> support (multiple pids are visible from the application, one
> for each created thread including the main one), and the
> other one a more recent NPTL-based pthread support (getpid()
> returns a single "main" pid per process, although the NTPL
> still enforces a 1:1 mapping between user-space and kernel
> threads that support them). This is not a Xenomai issue in
> fact, but rather a glibc one, given that Xenomai relies on
> the glibc to create user-space threads before promoting them
> to the real-time domain it controls.
>
> Reading this may help:
> http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//index.j
> sp?topic=/com.ibm.websphere.base.doc/info/aes/ae/cins_nptl.html
>
> Philippe.
>
Philippe,
What you described above is exactly what my issue was.
Also, the article link you provided was a great help.
Thanks VERY MUCH!
Dan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-03-16 13:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-14 21:50 [Xenomai-help] xenoami task pids Moser, Dan
2006-03-14 22:30 ` Jan Kiszka
2006-03-15 13:29 ` Philippe Gerum
-- strict thread matches above, loose matches on Subject: below --
2006-03-16 13:47 Moser, Dan
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.