What is the purpose of using httpd_queue_work?
Posted: Sat Jan 07, 2023 12:44 pm
Hi, I am looking at the http server component and found this function: httpd_queue_work. After tracing the source code, I found that It merely ask the http server thread to invoke the work callback immediately. The callback is not called in a standalone thread. I wonder what is the purpose of using this function? How does it achieve asynchronous request handling? From my understanding, either in the request callback or the work callback, I should not invoke any blocking function because it will block the whole server thread and make it unable to respond to any other requests. Then why and when should I use httpd_queue_work?
Thanks
Thanks