|
From: | Bob Furber |
Subject: | [libmicrohttpd] How to get response back to requesting thread? |
Date: | Wed, 18 Mar 2015 18:17:34 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
I have a ||custom ||server [C] ||program ||on a Linux-Arm platform ||which uses MHD ||as its||front end to receive and respond to http requests.| |||
Currently, each request is processed in its own thread ||to obtain the response||, with the processing code sandwiched inside a mutex to protect data from being altered by code in the main-loop ..which also accesses the same data. ||Think of the data as a home-baked database that is being altered by the main-loop AND by http requests.| |||
Dreaming in Technicolor, I would like to have all the data processing done in the main-loop. That is, request||s||would be transferred from the connection threads to the main-loop by means of some IPC ||FIFO ||process such as a message queue or named pipe. ||My problem is||, I cannot figure out how the main-loop would get the response back to the requesting thread.||
Again, d||reaming in Technicolor, ||I would like to use some magic IPC process where the MHD thread would tag the request with a return_response_to_this_pid ||return address ||to allow the main loop to deliver the response messages addressed to the corresponding corresponding MHD_thread ...an IPC method along the lines of send_ipc_msg( message, receiving_pid ). | |||
Clues anybody?| I am not even sure how to ask the right question. ||
[Prev in Thread] | Current Thread | [Next in Thread] |