All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] RT_QUEUE problem in Sender/Receiver order
@ 2010-04-19 17:01 Michel He
  2010-04-19 17:04 ` Gilles Chanteperdrix
  2010-04-19 17:16 ` Philippe Gerum
  0 siblings, 2 replies; 7+ messages in thread
From: Michel He @ 2010-04-19 17:01 UTC (permalink / raw)
  To: xenomai

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). 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 ?


	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




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-04-20 15:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2010-04-20 10:20       ` Michel He

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.