HTTP Server RTOS thread priority

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JoSt_3481606
Level 4
Level 4
First like received

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 ?

0 Likes
1 Solution
RaktimR_11
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

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.

View solution in original post

1 Reply
RaktimR_11
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

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.