Peeking concurrency messages

ikod geller.garry at gmail.com
Tue Jun 25 09:59:59 UTC 2019


On Sunday, 23 June 2019 at 16:25:58 UTC, Anonymouse wrote:

> I do blocking reads from the server, which time out after n 
> seconds. Inbetween reads it checks for concurrency messages 
> sent by plugins, to see if one wanted something, acts if so,

Another possible design (sorry if you already considered it and 
threw it away) would be call select/poll/kqueue on server socket 
and on the socketpair which 'connects' threaded plugin with the 
main loop. Each time plugin have message it sends it over 
std.concurrency and then wakes up main loop sending single byte 
over socketpair. This slightly complicate design and adds sockets 
housekeeping, but it works.


More information about the Digitalmars-d mailing list