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

Clojure's core.async has "go routines", (this is more or less the same as in go), basically you can put and take messages on a channel. These operations will block the green thread, so you end up writing synchronous code. The idea is that synchronous, blocking code is easier to understand then async code. Since these are lightweight threads it will scale better than using real threads. I'm pretty sure it's fine to have hundreds of thousands of go routines.

This abstraction sits on top of java's real threads, so you can have several real threads doing the work and they can switch between the go routines once the go routine hits one of the blocking operations.

Or something like that... read this: http://clojure.com/blog/2013/06/28/clojure-core-async-channe...




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

Search: