3 ms·
How different are tcl and node from select, poll, and epoll? I know tcl and node are runtimes - but what do you get extra in their event loops compared to stan
by lucidguppy 8y ago
How different are tcl and node from select, poll, and epoll?
I know tcl and node are runtimes - but what do you get extra in their event loops compared to standard event loops that Linux offers?
- sebcat 8y agoIt is difficult to compare languages with operating systems on which those languages can be executed/evaluated. On systems that implement them, Tcl can use select, epoll, kqueue for its event notification implementation, as well as pthread_cond_broadcast for threads (if built with thread support). take a look at: generic/tclNotify.c - https://core.tcl.tk/tcl/artifact/8804164706c8f2cb https://core.tcl.tk/tcl/artifact/8804164706c8f2cb unix/tclEpollNotfy.c - https://core.tcl.tk/tcl/artifact/892b68fa5a7c4c87 https://core.tcl.tk/tcl/artifact/892b68fa5a7c4c87
- Pete_D 8y agoWith select/poll, you have to write your own dispatcher, which means you have to care about details like whether you need round-robin to prevent early things in your fdset stopping later things being processed, etc. Also, many of the things you'd like to wait on aren't file descriptors, so you have to do extra work to make them fit. My bugbear for this is pthread condition variables, but it's also true of most GUI toolkits, which expect you to use some variation of while(Toolkit_GetEvent(&event)). You can work around these, of course, it's just mildly annoying extra work.