<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Child task to access message queue in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Child-task-to-access-message-queue/m-p/214518#M5393</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an easy way to allow any child task to receive messages from a private message queue? The code was orginally written as if the queue ID was enough information to access the messages on the queue.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;'Main_Task' creates pool / queue to the task 'RXI_Task'&lt;/P&gt;&lt;P&gt;'Main_Task' calls various functions which get data via the message queue to 'RXI_Task'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Main_Task' then creates several child tasks which can call the same functions called from 'Main_Task', these functions get the data via 'RXI_Task' queue. The problem is when these child tasks are created, the message queue ID is no longer enough to get the messages from 'RXI_Task', only 'Main_Task' can access those messages.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a mutex protecting the functions from multipule tasks trying to access the msgq.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do i have to rewrite this? or is there some other way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Sep 2009 08:17:28 GMT</pubDate>
    <dc:creator>CarlFST60L</dc:creator>
    <dc:date>2009-09-08T08:17:28Z</dc:date>
    <item>
      <title>Child task to access message queue</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Child-task-to-access-message-queue/m-p/214518#M5393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an easy way to allow any child task to receive messages from a private message queue? The code was orginally written as if the queue ID was enough information to access the messages on the queue.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;'Main_Task' creates pool / queue to the task 'RXI_Task'&lt;/P&gt;&lt;P&gt;'Main_Task' calls various functions which get data via the message queue to 'RXI_Task'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Main_Task' then creates several child tasks which can call the same functions called from 'Main_Task', these functions get the data via 'RXI_Task' queue. The problem is when these child tasks are created, the message queue ID is no longer enough to get the messages from 'RXI_Task', only 'Main_Task' can access those messages.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a mutex protecting the functions from multipule tasks trying to access the msgq.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do i have to rewrite this? or is there some other way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2009 08:17:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Child-task-to-access-message-queue/m-p/214518#M5393</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2009-09-08T08:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Child task to access message queue</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Child-task-to-access-message-queue/m-p/214519#M5394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carl,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you closing(with your Main Task) and reopening the Message Queue with the child task trying to receive the message?&lt;/P&gt;&lt;P&gt;Remember that Only the task that opens a private message queue can receive messages from the queue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And just a small question, if you are protecting the msgq with a mutex, should we protect message pools&lt;/P&gt;&lt;P&gt;with mutex too? I thought MQX protected this functions&amp;nbsp; by default?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;msg_ptr = (GENERIC_DATA_MSG_PTR)_msg_alloc(mp_QuadSPI);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If different priority tasks have calls to the instruction above, should we use Mutex to prevent simultaneous access?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2009 10:47:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Child-task-to-access-message-queue/m-p/214519#M5394</guid>
      <dc:creator>MQXuser</dc:creator>
      <dc:date>2009-09-08T10:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Child task to access message queue</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Child-task-to-access-message-queue/m-p/214520#M5395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Maybe it makes no sense, but it would be nice if what ever task knows the queue ID could get messages with that queue ID. Or is there was a simple way you could change ownership of the message queue.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2009 11:23:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Child-task-to-access-message-queue/m-p/214520#M5395</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2009-09-08T11:23:54Z</dc:date>
    </item>
  </channel>
</rss>

