1 Reply Latest reply on Jun 26, 2019 11:40 PM by RaktimR_11

    HTTP Server RTOS thread priority

    JoSt_3481606

      I have included an HTTP server to display my data using Ajax.  When the page is up in a browser and the client is making Ajax requests some of my other threads are interrupted for too long.  For example, I have a thread that communicates over a serial port every 30ms.  With the webpage up and Ajax requests processing with updates once per second, I can see data out the serial port being disrupted for 100-200 ms.  I am assuming that this is due to the http server having a higher thread priority.   There doesn't seem to be a way to lower it in the api.  I can bump the priority of my other threads to be higher than the http server.

       

      The http server is purely informational and should be the lowest priority in my app.

       

      How does the http server fundamentally operate with regards to the RTOS, threading and priority?  How can I control its priority or what priority do I have to run my threads so they take precedent ?

        • 1. Re: HTTP Server RTOS thread priority
          RaktimR_11

          WICED: HTTP Server

           

          Browser or some other HTTP client

           

          Based on the above mentioned scenario, you can change the thread priority of HTTP_SERVER in 43xxx_Wi-Fi/libraries/daemons/HTTP_server/http_server.c file. By default the thread priority is default library thread priority (5) which you can increase based on the other threads that you have been using.

           

          Please look for HTTP_SERVER_THREAD_PRIORITY in the above file to change the thread priority.

          1 of 1 people found this helpful