If you want or need to block in a go-block then you should use the `thread` macro instead of the `go` macro. A thread macro block will be ran in a cached thread pool as you seem to be wanting:

https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L379

Just note that you will need to use the blocking CSP operator variants, e.g. <!! instead of <!, while inside of `thread`.

-Ben

On 3/27/14, 9:24 AM, icamts wrote:
Thank you Ben.

Can we speculate on a go-off macro? Like in agents send / send-off to have go-off blocks executed by a cached thread pool executor?

Luca

Il giorno giovedì 27 marzo 2014 16:01:16 UTC+1, Ben Mabey ha scritto:

    I asked Timothy Baldridge about this on IRC when the change was
    made that added 42 and this was the reply I got:

       we're trying to strike a balance there, we don't want people to
    do IO inside a go block, but if they have to we'd don't want it to
    totally stall out.

    Here is the full conversation:

    http://clojure-log.n01se.net/date/2013-08-29.html#15:45a
    <http://clojure-log.n01se.net/date/2013-08-29.html#15:45a>

    -Ben

    On 3/27/14, 8:55 AM, icamts wrote:
    Hi all,
    quite a funny question. Thread pool size in core.async is twice
    the number of processors plus 42.

    
https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/exec/threadpool.clj
    
<https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/exec/threadpool.clj>


    42? The question is:

    1) should it be 4 or 2?
    2) 42 is the response to life, universe and everything
    3) for some technical reason 42 is also a good minimum number for
    a thread pool

    Luca
-- You received this message because you are subscribed to the Google
    Groups "Clojure" group.
    To post to this group, send email to clo...@googlegroups.com
    <javascript:>
    Note that posts from new members are moderated - please be
    patient with your first post.
    To unsubscribe from this group, send email to
    clojure+u...@googlegroups.com <javascript:>
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en
    <http://groups.google.com/group/clojure?hl=en>
    ---
    You received this message because you are subscribed to the
    Google Groups "Clojure" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to clojure+u...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com <mailto:clojure+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to