3 ms·
I want to have control over the nodejs mainloop to integrate it with GUI toolkits in C
by baybal2 6y ago
I want to have control over the nodejs mainloop to integrate it with GUI toolkits in C
- josh3736 6y agoI've done this kind of work in node before. You don't want that. The correct way to do this is to write a native addon that uses libuv to create your own thread (`uv_thread_create`) that does all the interaction with the GUI APIs. You then manage your own message queue to pass messages between your GUI thread and the V8 thread (using `uv_async_send` to invoke a C function that dispatches events from the queue into JS-land).
- tengbretson 6y agoI've worked with tools that do this sort of thing and the only way to get the sort of synchronization your asking for was to essentially peg an entire CPU core to 100% utilization.