Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The canonical way to do concurrency these days is with a monadic library like Lwt or Async, which is a mechanism akin to promises/deferreds. They have their own implementations of channels/events/streams/what-call-you-it.

There is some interesting work being done on an effects system [1] which would be another option for type-safe concurrency, hopefully it will land soon alongside the multicore work.

There is also the old fashioned way with the stdlib's Event module[2] (in conjunction with Thread), but that's not used as often, mostly because Lwt/Async offer richer, safer abstractions.

[1] http://kcsrk.info/ocaml/multicore/2015/05/20/effects-multico...

[2] http://caml.inria.fr/pub/docs/manual-ocaml/libref/Event.html



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

Search: