I read this wonderful article about core.async here:
http://www.core-async.info/reference/primitives
I'm struggling to understand internal mechanics! and go. I understand that:
- to put! is asynchronous and can receive a callback. This works well in simple scripts, but you can end the callback addon.
- go fixes the callback addon and allows you to write asynchronous code in a synchronous style.
- go uses a lightweight pool of threads and uses parking to enable concurrency.
- go uses a state machine
I do not understand:
- How to bet! achieve asynchrony? Does it also use thread pool?
- Does! also uses parking?
- What is the role of the state machine in the go block? Is that what parking allows?
- Should I always try to use put! rather than go because it is cheaper? In this case, it means it is laid! achieve the same concurrency of kindness as go, and this transition is used when I want to talk about complex asynchronous code?
Thank you very much for shedding light on these secrets.
source
share