Message-ID: <20061016153937.54204.qmail@domain.hid> Date: Mon, 16 Oct 2006 08:39:37 -0700 (PDT) From: mani bhatti MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1652324942-1161013177=:54134" Content-Transfer-Encoding: 8bit Subject: [Xenomai-help] Problem with rt_queue List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org --0-1652324942-1161013177=:54134 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi all I am trying to broadcast a message to a queue from a producer by using function rt_queue_send(&queue_input, msg,sizeof(TInputData), Q_BROADCAST); I have two consumers waiting for the data from producer but the problem is producer is not broadcasting actually to all consumers and at one time if i run both consumers than only one of the consumer receives the data from producer the other consumer receives nothing and remains blank (the consumer which receives data from queue is not fixed it is arbitrary).If some one has encountered the problem before please advice me in this regard-Thanks all.The producer code is given below while(!end){ rt_task_wait_period(); void *msg = rt_queue_alloc(&queue_input, sizeof(TInputData)); if(msg == NULL) { printf("rt_queue_alloc(queue_inout, %d) failed\n",sizeof(TInputData)); } memcpy(msg, &sendData, sizeof(TInputData)); int bytesSent = rt_queue_send(&queue_input,msg,sizeof(TInputData), Q_BROADCAST); if (bytesSent <= 0) { printf("rt_queue_send(queue_input) failed: %d\n", bytesSent); rt_queue_free(&queue_input, msg); } sendData.counter++; } --------------------------------- Do you Yahoo!? Get on board. You're invited to try the new Yahoo! Mail. --0-1652324942-1161013177=:54134 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi all
I am trying to broadcast a message to a queue  from a producer by using function

rt_queue_send(&queue_input, msg,sizeof(TInputData), Q_BROADCAST);

I have two consumers waiting for the data from producer but the problem is producer is not broadcasting actually to all consumers and  at one time if i run both consumers than only one of the consumer receives the data from producer the other consumer receives nothing and remains blank (the consumer which receives data from queue  is not fixed it is arbitrary).If some one has encountered the problem before please advice me in this regard-Thanks all.The producer code is given below

 while(!end){
               rt_task_wait_period();
               void *msg = rt_queue_alloc(&queue_input, sizeof(TInputData));
                if(msg == NULL) {
                        printf("rt_queue_alloc(queue_inout, %d) failed\n",sizeof(TInputData));
                     }
                memcpy(msg, &sendData, sizeof(TInputData));
                int bytesSent = rt_queue_send(&queue_input,msg,sizeof(TInputData), Q_BROADCAST);
                if (bytesSent <= 0) {
                        printf("rt_queue_send(queue_input) failed: %d\n", bytesSent);
                        rt_queue_free(&queue_input, msg);
                }
                sendData.counter++;
        }



Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail. --0-1652324942-1161013177=:54134--