If I try to register socket callback on the side thread, I get JS exception
mentioning Module['websocket'] is undefined. I've tried adding the code to
do FS.mount(SOCKFS, {}, null); explicitely from pthread_main.js. Even
though that help getting rid of the exception, I didn't see sockets
notifications.
On Tuesday, 12 February 2019 19:40:02 UTC+5:30, NileshM wrote:
>
> To describe more, here is the problem I'm working on -
>
> The code have periodic processing logic in the main thread making it busy.
> There are other threads in the native C++ code waiting for data to be
> available on various sockets. To consume less CPU, I'm making these threads
> wait on socket specific event objects until data is available.
> Since notifications are arrived on the main thread which is busy most of
> the time, side threads ends up waiting for significantly longer time before
> getting unlocked via sockets notifications. This is slowing down the
> performance of the application.
>
> If there is any way of receiving socket callbacks on the side thread, that
> can greatly help in accelerating our sockets code with optimal CPU.
> Any help with that is much appreciated.
>
>
> On Thursday, 7 February 2019 11:11:28 UTC+5:30, NileshM wrote:
>>
>> Anyone?
>>
>> On Monday, 4 February 2019 15:35:11 UTC+5:30, NileshM wrote:
>>>
>>> Hi,
>>>
>>> While working on sockets I've realized that
>>> emscripten_socket_message_callback() works only when called from main
>>> thread. Also the notifications received are in context of main thread.
>>>
>>> 1. Is there a way to receive socket related callbacks on web-worker and
>>> register from there? This can greatly simplify our logic which carries out
>>> most of its logic in the main thread delaying the socket notifications.
>>> 2. Is there a way to register socket-fd specific callback instead of
>>> global callback?
>>>
>>> Thanks!
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.