Thank you for the clarification. If I understand it correctly, these 
callbacks in case of go 'threads' resume the parked state machine, so if 
there is a blocking IO inside go block, it ends up waiting in one of these 
callbacks, thus tying up a thread from a fixed sized pool until IO 
operation unblocks it.

JW

On Friday, January 31, 2014 4:51:11 AM UTC+1, tbc++ wrote:
>
> To quote Jozef "it can happen all in one thread". This is somewhat true, 
> there are some rare situations where this can happen, but it is fairly 
> rare. 
>
> Many times putting a value into a channel will mean that the callback on 
> the other end of the channel needs to be dispatched. In that case Mauricio 
> is correct, these callbacks are executed in a fixed sized thread pool. 
>
> Timothy
>
>
> On Thu, Jan 30, 2014 at 8:41 PM, Mauricio Aldazosa <
> mauricio...@ciencias.unam.mx <javascript:>> wrote:
>
>>
>> On Thu, Jan 30, 2014 at 12:48 PM, Jozef Wagner 
>> <jozef....@gmail.com<javascript:>
>> > wrote:
>>  
>>>
>>> go blocks, together with >!, <!, alt!, etc... do not create any new 
>>> threads and are not run in separate thread. There is no thread pool for go 
>>> blocks.
>>>
>>
>> I thought that go blocks do run in a thread pool of size 42 + (2 * Num of 
>> processors). In the definition of the go macro there is a 
>> dispatch/run<https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L369>whose
>>  
>> docstring<https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/dispatch.clj#L19>says
>>  it uses a thread pool. 
>>
>> Am I misunderstanding something?
>>
>> -- 
>> 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
>> --- 
>> 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/groups/opt_out.
>>
>
>
>
> -- 
> “One of the main causes of the fall of the Roman Empire was that–lacking 
> zero–they had no way to indicate successful termination of their C 
> programs.”
> (Robert Firth) 
>

-- 
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/groups/opt_out.

Reply via email to