From: Philippe Gerum <rpm@xenomai.org>
To: Josh Bowman <jbowman@domain.hid>
Cc: xenomai@xenomai.org, Michel He <michel.he@domain.hid>
Subject: Re: [Xenomai-help] RT_QUEUE problem in Sender/Receiver order
Date: Tue, 20 Apr 2010 10:22:55 +0200 [thread overview]
Message-ID: <1271751775.8407.14.camel@domain.hid> (raw)
In-Reply-To: <g2tdd8925a51004192146m3dc41c1la59720974282b961@domain.hid>
On Tue, 2010-04-20 at 00:46 -0400, Josh Bowman wrote:
> Hi,
>
> I'm reluctant to jump in here with my own notably limited psychic
> powers, but I did notice that the code given spawns the receiving
> tasks before it creates the queues that they receive from. This would
> create a race condition (if a STD_PRIO task can preempt the task
> that's doing the initialization.)
>
You are likely right, priority issues are usually involved in that
scenario, particularly since the initiator of all those creation calls
is the low-priority root thread.
> -Josh
>
> On Mon, Apr 19, 2010 at 1:16 PM, Philippe Gerum <rpm@xenomai.org>
> wrote:
> On Mon, 2010-04-19 at 19:01 +0200, Michel He wrote:
>
> >
> > err = rt_task_spawn(&test_task2_ptr, "Recep2",
> STACK_SIZE, STD_PRIO,
> > 0, &testtask2, NULL);
> > if (err) {
> > rt_printf("error rt_task_spawn 2\n");
> > return 0;
> > }
> > recvTask[nrecvhost]=&test_task2_ptr;
> >
> > err =
> >
> rt_queue_create(&(recvCanal[nrecvhost]),"Recep2CANAL",MAX_MESSAGE_LENGTH,
> > QUEUE_LIM, Q_FIFO);
> >
> > if (err) {
> > rt_printf("error RT_canal_create 2 \n");
> > return 0;
> > }
> > nrecvhost++;
> >
> >
> > err = rt_task_spawn(&test_task3_ptr, "Recep3",
> STACK_SIZE, STD_PRIO,
> > 0, &testtask3, NULL);
> > if (err) {
> > rt_printf("error rt_task_spawn 3\n");
> > return 0;
> > }
> > recvTask[nrecvhost]=&test_task3_ptr;
> >
> > err =
> >
> rt_queue_create(&(recvCanal[nrecvhost]),"Recep3CANAL",MAX_MESSAGE_LENGTH,
> > QUEUE_LIM, Q_FIFO);
> >
> > if (err) {
> > rt_printf("error RT_canal_create 2 \n");
> > return 0;
> >
> > }
> > nrecvhost++;
> >
> >
> > err = rt_task_spawn(&test_task_ptr, "Sender",
> STACK_SIZE, STD_PRIO,
> > 0, &testtask, NULL);
> > if (err) {
> > rt_printf("error rt_task_spawn\n");
> > return 0;
> > }
> > recvTask[nrecvhost]=&test_task_ptr;
> > nrecvhost++;
> >
> >
> >
> > testtask2()
> > {
> > ...
> >
> rcbytes=RT_queue_read(&(recvCanal[0]),&rcvmsg,sizeof(rcvmsg),TM_INFINITE);
> > }
> >
> >
> > testtask3()
> > {
> > ...
> >
> rcbytes=RT_queue_read(&(recvCanal[1]),&rcvmsg,sizeof(rcvmsg),TM_INFINITE);
> > }
> >
>
>
--
Philippe.
next prev parent reply other threads:[~2010-04-20 8:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-19 17:01 [Xenomai-help] RT_QUEUE problem in Sender/Receiver order Michel He
2010-04-19 17:04 ` Gilles Chanteperdrix
2010-04-20 15:21 ` Michel He
2010-04-19 17:16 ` Philippe Gerum
2010-04-20 4:46 ` Josh Bowman
2010-04-20 8:22 ` Philippe Gerum [this message]
2010-04-20 10:20 ` Michel He
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=1271751775.8407.14.camel@domain.hid \
--to=rpm@xenomai.org \
--cc=jbowman@domain.hid \
--cc=michel.he@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.