<?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: Where to place a Mutex for ALL .cgi functions?</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Where-to-place-a-Mutex-for-ALL-cgi-functions/m-p/174463#M2187</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to completely disable cgi functions for a while, I think you can use HTTPD_SET_PARAM_CGI_TBL() macro and set some empty table, or table with dummy callbacks.&lt;/P&gt;&lt;P&gt;For more information, see webserver_demo.c (security_webserver).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PetrM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Feb 2010 20:14:43 GMT</pubDate>
    <dc:creator>PetrM</dc:creator>
    <dc:date>2010-02-10T20:14:43Z</dc:date>
    <item>
      <title>Where to place a Mutex for ALL .cgi functions?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Where-to-place-a-Mutex-for-ALL-cgi-functions/m-p/174462#M2186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All of my .cgi functions use variables which I am also using into another Task. I would like to place a Mutex to prevent every .cgi function from running while my Main Task is running.&lt;/P&gt;&lt;P&gt;Is there a place in the source code where I can place this mutex without having to place a mutex in each .cgi function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if I the question isn't very clear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 06:15:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Where-to-place-a-Mutex-for-ALL-cgi-functions/m-p/174462#M2186</guid>
      <dc:creator>MQXuser</dc:creator>
      <dc:date>2010-02-10T06:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Where to place a Mutex for ALL .cgi functions?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Where-to-place-a-Mutex-for-ALL-cgi-functions/m-p/174463#M2187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to completely disable cgi functions for a while, I think you can use HTTPD_SET_PARAM_CGI_TBL() macro and set some empty table, or table with dummy callbacks.&lt;/P&gt;&lt;P&gt;For more information, see webserver_demo.c (security_webserver).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PetrM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 20:14:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Where-to-place-a-Mutex-for-ALL-cgi-functions/m-p/174463#M2187</guid>
      <dc:creator>PetrM</dc:creator>
      <dc:date>2010-02-10T20:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Where to place a Mutex for ALL .cgi functions?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Where-to-place-a-Mutex-for-ALL-cgi-functions/m-p/174464#M2188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your answer. Just to check if I understood correctly:&lt;/P&gt;&lt;P&gt;1.- Do you mean to say that I can change dynamically and asyncrhonously the value of the cgi function table?&lt;/P&gt;&lt;P&gt;2.- Could I do something like the following?&lt;/P&gt;&lt;P&gt;3.- What would happen if a cgi function is already running when I change the&amp;nbsp; table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
void Main_task(uint_32 index){
  
   while(TRUE){
      HTTPD_SET_PARAM_CGI_TBL(server,HTTPD_CGI_LINK_STRUCT*)&lt;SPAN&gt;dummy_lnk_tbl&lt;/SPAN&gt;);
      //Functions using a lot of CGI variables
      //Functions using a lot of CGI variables
      //Functions using a lot of CGI variables    
      HTTPD_SET_PARAM_CGI_TBL(server,HTTPD_CGI_LINK_STRUCT*)&lt;SPAN&gt;cgi_lnk_tbl&lt;/SPAN&gt;);
      _time_delay(150);
   }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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>Thu, 29 Oct 2020 09:23:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Where-to-place-a-Mutex-for-ALL-cgi-functions/m-p/174464#M2188</guid>
      <dc:creator>MQXuser</dc:creator>
      <dc:date>2020-10-29T09:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Where to place a Mutex for ALL .cgi functions?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Where-to-place-a-Mutex-for-ALL-cgi-functions/m-p/174465#M2189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I think it's possible to dynamically change it. It can just happen, that one request will be processed still using old table just after the switch.&lt;/P&gt;&lt;P&gt;But as I see you intention now, it's not good idea to use it like this. I thought, that you would like to temporarily disable web pages once a long time period.&lt;/P&gt;&lt;P&gt;So, unless you have write-write conflict, you don't have to switch the table nor use mutexes at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PetrM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 20:42:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Where-to-place-a-Mutex-for-ALL-cgi-functions/m-p/174465#M2189</guid>
      <dc:creator>PetrM</dc:creator>
      <dc:date>2010-02-11T20:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Where to place a Mutex for ALL .cgi functions?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Where-to-place-a-Mutex-for-ALL-cgi-functions/m-p/174466#M2190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, would it be okay to read a global variable from different tasks without a protection mechanism (mutex) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What about write-read?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2010 06:32:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Where-to-place-a-Mutex-for-ALL-cgi-functions/m-p/174466#M2190</guid>
      <dc:creator>MQXuser</dc:creator>
      <dc:date>2010-02-19T06:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Where to place a Mutex for ALL .cgi functions?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Where-to-place-a-Mutex-for-ALL-cgi-functions/m-p/174467#M2191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just reads are not a problem. No mutexes.&lt;/P&gt;&lt;P&gt;One write + reads is ok for non dynamic variables (no pointer re-allocation).&lt;/P&gt;&lt;P&gt;Otherwise you have to use mutexes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2010 22:34:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Where-to-place-a-Mutex-for-ALL-cgi-functions/m-p/174467#M2191</guid>
      <dc:creator>PetrM</dc:creator>
      <dc:date>2010-02-19T22:34:53Z</dc:date>
    </item>
  </channel>
</rss>

