|
From: | Evgeny Grin |
Subject: | Re: [libmicrohttpd] race condition on 0.9.73 |
Date: | Thu, 23 Sep 2021 18:14:24 +0300 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 |
Hi José,For sure you can run MHD with "external poll" mode, but you must ensure that only single thread is calling MHD_run() at any given moment of time.
If you want to call several copies of MHD_run(), make sure that you have individual copies of MHD for each thread (start MHD by MHD_start_daemon() for every thread).
Alternatively, you can use MHD with its own threading mode. MHD can run treads per connection or use thread pool.
Can you give more details how you use MHD? Which flags are used? Why do you use external threads instead of MHD internal treads? -- Wishes, Evgeny On 23.09.2021 13:17, José Bollo wrote:
Hi, My program sends answers in threads and runs the main MHD loop on external event in an other thread and I get crashes. I'm suspecting LMHD because valgrind point out that the memory for response is used after free in a kind of race condition between internals of MHD. Is it a known issue fixed since 0.9.73? I can either check why (if the program is correct to use multiple threads) or protect defensively (by removing implied concurrence externally -sub optimal probably-). Though? Best regard José
OpenPGP_signature
Description: OpenPGP digital signature
[Prev in Thread] | Current Thread | [Next in Thread] |