News for hackers. Stuff that matters.
Re:Channels in Common Lisp by jgalt212 on Friday January 20, 2017 @06:36AM (#13443080)
As I understand it, there are multiple ways to do concurrency in Clojure. Is there a best way or a way that fits most use cases so that you should at least try feature X before features Y, Z, and/or roll your own?
Re:Channels in Common Lisp by nickik on Friday January 20, 2017 @02:00PM (#13446104)
There is no easy path you can follow sadly. It depends on your use case quite a bit. Clojure gives you a lot of options and you have to find your own way.

What Clojure gives you by default, are thread safe mutation constructs, atoms, agents and refs that help a lot if you want to do simply concurrent things without worrying about race conditions.

Clojure also has support to get some data parallelism, you can easily do a lot with reducers and transducers. Its quite nice.

For more complex stuff, core.async gives you a powerful CSP library, its as powerful as what the Go programming language gives you (I think its nicer because Go has statements instead of expressions).

Because Clojure is on the JVM, you get access to all the Java stuff, java.util.conncurrent, and you can get a lot of powerful tools there (ThreadPools and stuff like that).