From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Mauro Salvini <mauro.salvini@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Problems with rt_task_create and rt_task_join
Date: Fri, 11 Feb 2011 10:56:24 +0100 [thread overview]
Message-ID: <4D5507C8.5070400@domain.hid> (raw)
In-Reply-To: <15658959.21297411846156.JavaMail.SYSTEM@pc-msalvini>
Mauro Salvini wrote:
>> Well, looking at the code, this should not happen. The question is:
>> how do you ensure, in the code that calls rt_task_join, that the
>> thread being created had the time to call rt_task_shadow? In other
>> words, are you sure that you are not passing rt_task_join an
>> uninitialized RT_TASK?
>
>> So, as usual, we are missing a simple standalone test showing the
>> issue you have.
>
> There was a subtle bug that realizes exactly what you explained,
> thank you!
This is not exactly a subtle bug.
> Question is: after a successful rt_task_shadow() call done
> by a pthread, we can forget that this rt-task was created as pthread
> and then we must handle it with rt_task_* procedures, is it right? In
> other words, does pthread become a RT_TASK at all, as if it was
> created with rt_task_create()?
No, an RT_TASK is also a pthread, whether created with rt_task_shadow or
rt_task_create (if you look at src/skins/native/task.c, you will see
that rt_task_create creates a thread with pthread_create which does the
same thing as rt_task_shadow). You saw that rt_task_join was using
pthread_join under the hood. And by the way, rt_task_shadow by itself is
mainly useful for turning the main thread into an RT_TASK, it is simpler
to create other RT_TASKs with rt_task_create.
--
Gilles.
next prev parent reply other threads:[~2011-02-11 9:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8701358.01297411757328.JavaMail.SYSTEM@pc-msalvini>
2011-02-11 8:10 ` [Xenomai-help] Problems with rt_task_create and rt_task_join Mauro Salvini
2011-02-11 9:56 ` Gilles Chanteperdrix [this message]
[not found] <21381658.41297350790328.JavaMail.SYSTEM@pc-msalvini>
2011-02-10 15:20 ` Mauro Salvini
2011-02-10 16:14 ` Gilles Chanteperdrix
[not found] <29582899.21296203622078.JavaMail.SYSTEM@PC-MRINALDI>
2011-01-28 8:34 ` Michel Rinaldi
2011-01-28 17:43 ` Gilles Chanteperdrix
[not found] <11269195.111296118370328.JavaMail.SYSTEM@PC-MRINALDI>
2011-01-27 8:58 ` Michel Rinaldi
2011-01-27 13:36 ` Gilles Chanteperdrix
[not found] <20964580.81295961364859.JavaMail.SYSTEM@PC-MRINALDI>
2011-01-25 13:17 ` Michel Rinaldi
2011-01-25 13:26 ` Gilles Chanteperdrix
[not found] <22536578.91295887083468.JavaMail.SYSTEM@PC-MRINALDI>
2011-01-24 16:39 ` Michel Rinaldi
2011-01-24 16:44 ` Gilles Chanteperdrix
2011-01-24 16:54 ` Gilles Chanteperdrix
[not found] <24653571.21295878006500.JavaMail.SYSTEM@PC-MRINALDI>
2011-01-24 14:07 ` Michel Rinaldi
[not found] <14515395.201295629170328.JavaMail.SYSTEM@PC-MRINALDI>
2011-01-21 17:01 ` Michel Rinaldi
2011-01-21 17:11 ` Philippe Gerum
2011-01-22 14:26 ` Mauro
2011-01-22 19:14 ` Gilles Chanteperdrix
2011-01-24 14:05 ` Michel Rinaldi
2011-01-24 14:27 ` Gilles Chanteperdrix
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D5507C8.5070400@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=mauro.salvini@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.