[Libwebsockets] libwebsocket LWS_CALLBACK_GET_THREAD_ID
andy at warmcat.com
Sat Jul 5 05:38:45 CEST 2014
On 05/26/2014 02:53 PM, Micka wrote:
> I wanted to know if it's normal that in my protocol function I received
> a lot of LWS_CALLBACK_GET_THREAD_ID
> It happens all the time .....
Yes it's normal, it's used to understand if you're asking for a
writeable callback from another thread.
It shouldn't be happening if your system is otherwise idle, lws CPU
should be like 0%.
But if your server is active you'll be getting these when it does
something. pthread_self should be really cheap though.
> that is my return :
> return pthread_self();
> And I don't use that :
> * if you will call "libwebsocket_callback_on_writable"
> * from a different thread, return the caller thread ID
> * here so lws can use this information to work out if it
> * should signal the poll() loop to exit and restart early
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
More information about the Libwebsockets