On Thu, 23 Sep 2021 18:14:24 +0300
Evgeny Grin <[email protected]> wrote:
> Hi José,
Hi Evgeny,
> 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.
Okay, that is a good hint, thanks. I'm going to first track concurrent
use of MHD_run. FYI, I tried the latest git and got the same issue.
> 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).
I don't want that, because it implies differents port I suppose.
> 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?
flags = MHD_USE_EPOLL
| MHD_ALLOW_UPGRADE
| MHD_USE_TCP_FASTOPEN
| MHD_USE_NO_LISTEN_SOCKET
| MHD_ALLOW_SUSPEND_RESUME;
> Why do you use external threads instead of MHD internal treads?
The program has a job scheduler that manages threads on its own. It
also serves other protocols that HTTP(S).
best regards
josé