From: Philippe Gerum <rpm@xenomai.org>
To: Michel He <michel.he@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] RT_QUEUE problem in Sender/Receiver order
Date: Mon, 19 Apr 2010 19:16:14 +0200 [thread overview]
Message-ID: <1271697374.16659.156.camel@domain.hid> (raw)
In-Reply-To: <20100419190151.56913gdansdxkhvk@domain.hid>
On Mon, 2010-04-19 at 19:01 +0200, Michel He wrote:
> hello everyone,
>
> I find out a problem (it seems already mentionned before but I
> can't find the link to the forum and the post).
Ok. In the same vein, it turns out that you might be right, but I could
not find the link to the post that says so.
> It deals with the
> message passing, eg. when we change the order of task execution,
> something can get wrong. Notice that codes below, if we launch the
> exection of Recep2,Recep3,Sender, Recep2 won't get the right message.
> But if we change the order to : Sender,Recep2,Recep3, everything is
> back to OK. So any explanation ?
Any explanation from your end about what you would consider as a correct
result from that code, or should we resort to our well-known psychic
power to find it?
>
>
> 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);
> }
>
>
> thank you
>
>
>
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
--
Philippe.
next prev parent reply other threads:[~2010-04-19 17:16 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 [this message]
2010-04-20 4:46 ` Josh Bowman
2010-04-20 8:22 ` Philippe Gerum
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=1271697374.16659.156.camel@domain.hid \
--to=rpm@xenomai.org \
--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.