<?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>MQX Software Solutions中的主题 Re: Suggested improvement for lwsem</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Suggested-improvement-for-lwsem/m-p/329293#M10518</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks for the feedback.&lt;/P&gt;&lt;P&gt;I understand that the lwsem structure doesn't have owner information, but surely if the structure is freed during task destruction, the semaphore wont work properly - resulting in crash and unpredictable behavior (that's what we saw).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Sep 2014 21:37:05 GMT</pubDate>
    <dc:creator>chrissolomon</dc:creator>
    <dc:date>2014-09-01T21:37:05Z</dc:date>
    <item>
      <title>Suggested improvement for lwsem</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Suggested-improvement-for-lwsem/m-p/329291#M10516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;we have just spend a few days tracking down a bug in our application, (running on MQX 4.0.1).&lt;/P&gt;&lt;P&gt;The problem ended up being tracked down to lw semaphores being in the linked list after they were freed by task destruction.&lt;/P&gt;&lt;P&gt;Subsequent allocation reused the memory, so the behavior was unpredictable and changed with seemingly unrelated alterations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this can be solved by putting the semaphore struct pointers into a context and having a task exit function, but I this is laborious.&lt;/P&gt;&lt;P&gt;I suggest that in the default task exit handler, prior to freeing memory allocated by the task, the semaphore linked list be checked to see if the any of the semaphore structures are within blocks to be freed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I realize that this is an overhead, but task destruction is not done frequently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 05:55:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Suggested-improvement-for-lwsem/m-p/329291#M10516</guid>
      <dc:creator>chrissolomon</dc:creator>
      <dc:date>2014-09-01T05:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Suggested improvement for lwsem</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Suggested-improvement-for-lwsem/m-p/329292#M10517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your proposal, however this is difficult to apply.&lt;/P&gt;&lt;P&gt;Lightweight semaphores are a simpler, low-overhead implementation of semaphores. Lightweight semaphores don’t contain any information about owner therefore system doesn’t know whether it could be destroyed.&lt;/P&gt;&lt;P&gt;Lightweight semaphores are typically used for synchronization between tasks and unpredictable destroy of lightweight semaphore by task exit handler will probably cause application crash (or loose of functionality) in most of cases. So, I believe that it is designer duty to care about synchronization mechanism when they want destroy a task.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;RadekS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 15:13:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Suggested-improvement-for-lwsem/m-p/329292#M10517</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2014-09-01T15:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Suggested improvement for lwsem</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Suggested-improvement-for-lwsem/m-p/329293#M10518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks for the feedback.&lt;/P&gt;&lt;P&gt;I understand that the lwsem structure doesn't have owner information, but surely if the structure is freed during task destruction, the semaphore wont work properly - resulting in crash and unpredictable behavior (that's what we saw).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2014 21:37:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Suggested-improvement-for-lwsem/m-p/329293#M10518</guid>
      <dc:creator>chrissolomon</dc:creator>
      <dc:date>2014-09-01T21:37:05Z</dc:date>
    </item>
  </channel>
</rss>

