[Libwebsockets] Using libuv threads with libwebsockets in windows

Meir Yanovich meiry242 at gmail.com
Thu May 26 08:02:08 CEST 2016


Thanks ,
well i only what to be able to insert , wsi + user id info into hashmap ,
this is the only place i want to use mutex protection.

On Thu, May 26, 2016 at 8:43 AM, Andy Green <andy at warmcat.com> wrote:

>
>
> On 05/26/2016 01:31 PM, Meir Yanovich wrote:
>
>> Hello
>> libwebsockets is using pthreads according to test-server-pthreads.c ,
>>
>
> Well, it *can* use pthreads is what you should draw from that.
>
> That version of the test server is showing how to do the test server
> things if you wanted to do them in pthreads.  But it's optional.  By
> default, lws has no pthreads code arranged to be built and no dependency on
> it.
>
> i dont what to install pthreads wrapper on windows .
>> so i like to use the one libuv has .
>> is it problem from libsockets point of view ?
>>
>
> No, but like libuv itself, lws is designed to work out of a single
> nonblocking thread.  It's not threadsafe.
>
> It's fine if lws + libuv are left alone in their own service thread.  If
> you want to do something from another thread though, the only safe lws api
> to call is lws_callback_on_writable(), triggering the service thread to do
> whatever it is you wanted to do.
>
> -Andy
>
> Thanks
>>
>>
>> _______________________________________________
>> Libwebsockets mailing list
>> Libwebsockets at ml.libwebsockets.org
>> http://libwebsockets.org/mailman/listinfo/libwebsockets
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20160526/a7c0c5e1/attachment-0001.html>


More information about the Libwebsockets mailing list