This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-30
Channels
- # bangalore-clj (1)
- # beginners (23)
- # boot (1)
- # cider (23)
- # cljsjs (2)
- # cljsrn (4)
- # clojure (251)
- # clojure-dusseldorf (2)
- # clojure-gamedev (23)
- # clojure-italy (5)
- # clojure-russia (53)
- # clojure-sanfrancisco (5)
- # clojure-spec (7)
- # clojure-uk (66)
- # clojurescript (169)
- # community-development (21)
- # core-async (10)
- # cursive (15)
- # data-science (1)
- # datomic (7)
- # docker (1)
- # emacs (24)
- # events (1)
- # funcool (6)
- # hoplon (24)
- # liberator (1)
- # luminus (6)
- # lumo (62)
- # mount (7)
- # off-topic (1)
- # om (12)
- # om-next (5)
- # onyx (14)
- # overtone (2)
- # pedestal (58)
- # powderkeg (27)
- # protorepl (1)
- # re-frame (1)
- # ring-swagger (16)
- # rum (51)
- # spacemacs (25)
- # uncomplicate (7)
- # unrepl (22)
- # untangled (7)
- # yada (109)
Hello! I'm trying to wrap my head around pipeline
and pipeline-blocking
. How exactly we are going to execute parallelism if operations are blocking? Or what does it mean that it's (pipeline-blocking) for blocking operations?
it's for cases where the parallelized code might block its own thread
eg. it does IO without an async IO wrapper
your original thread (the one that calls pipeline-blocking) is not blocked, but the difference is which kind of context the parallel code should run in
so pipeline or pipeline-async are safe for code that is async (and you want it to run in multiple async blocks), and pipeline-blocking is for code that would hog the thread, so it needs a (more expensive) thread from a different pool
since core.async only uses 8 threads in its pool by default, you need to be careful not to starve it by blocking its threads
hope that's clear
@troglotit It took me a while to understand as well but make sure you use pipeline-blocking
for an deref
/`@ `. It seems obvious but I often tripped over my code deadlocking so "no reason" even though I was at fault.