[Libwebsockets] threads?!

Alexander Zvyagin zvyagin.alexander at gmail.com
Mon Mar 11 14:03:28 CET 2019


Hi,

I would like to start to use threads in my code to avoid blocking in
my server code. What is the recommended way to achieve that?!

My code is written in C++ and I would like to stay as close to the
standard practice of writing such code as possible. On the other hand
libwebsockets already has its own threadpool implemntation. And there
are "minimal-ws-server-threadpool" and "minimal-ws-server-threads"
examples. Which path should I take?

Also, do I understand correctly, that my threads should call
lws_cancel_service() (with a mutex lock, of course) to communicate
with the main libwebsocket loop?

Thanks a lot in advance,
Alexander.


More information about the Libwebsockets mailing list