Hacker News new | past | comments | ask | show | jobs | submit login

Hmm. Most of what I've seen uses mutexes and semaphores for synchronization. Do you have actors and/or channels libraries for C++? I recon you do, but how good are they?



I don't know much about the public actors or channels libraries for C++, since I work on a project that rolled its own green threads system and doesn't have much of a use for channels -- we end up having types that perform fifo enforcement in other ways, and our way of "sending a message" is often popping a green thread that switches itself to the appropriate POSIX thread before doing something, using some sort of fifo enforcement object to rearrange things in the right order at the right time (and then holding a short term userland single-threaded lock -- with no cross-posix-thread synchronization -- to do some atomic business once you get your turn).

You could create a channel library that is "as good as" other libraries you'd see, except that they'd use C++ constructors/destructors and you might want a family of channel types depending on ownership semantics -- such as a single-producer single-consumer channel, versus a (less performant) channel with more shared ownership.

The state of existing actors or channels libraries is probably dismal. A channels library would need to be rolled together with a specific green threads system, and that's one of the advantages Go or other languages with a canonical green threads implementation has.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: