<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Switch from TI-RTOS to SimpleLink POSIX: From MailBox to Message Queue</title><link>/members-area/personalblogs/b/blog/posts/switch-from-ti-rtos-to-simplelink-posix-from-mailbox-to-message-queue</link><description>A real world migration from TI-RTOS to the POSIX API of TI SimpleLink.Texas Instruments migrated from the proprietary TI-RTOS to the open POSIX API.I&amp;#39;m migrating a project that extensively used the TI paradigms to that POSIX API. You&amp;#39;re my wi...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Switch from TI-RTOS to SimpleLink POSIX: From MailBox to Message Queue</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/switch-from-ti-rtos-to-simplelink-posix-from-mailbox-to-message-queue</link><pubDate>Sat, 12 May 2018 17:15:16 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:247b29d5-41e8-47ee-aca5-286210e9e411</guid><dc:creator>gecoz</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hi Jan,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I believe the POSIX queue is ultimately implemented as a file on the system (making it persistent to reboot). Just like files, it is managed using descriptors, which is a finite resource of the system. &lt;/p&gt;&lt;p&gt;The mq_open() call associates a descriptor to the queue, and normally I would expect the caller to release the descriptor once finished using it. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;blockquote class="jive-quote"&gt;&lt;p&gt;&lt;span&gt;...In this case, we open the queue for writing. I don&amp;#39;t close the queue - not sure if that&amp;#39;s correct or if I&amp;#39;m leaking resources...&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Now, if the sender side is implemented as a short lived process, it is probably OK to omit the call to mq_close(), as all the resources used by a process are automatically released upon process&amp;#39; termination.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;But if your sender is part of a long lived process (i.e. a daemon), and your function is going to be invoked multiple times, then it is advisable to add a call to mq_close() before exiting the function.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Fabio&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=4805&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>