Yes that won't work. If something locks up the JavaScript process with an
infinite loop those other go blocks will never get a chance to run. I
believe even wrapping the final loop/recur in a go block won't help the
issue.

But I don't think this is a limitation in practice.


On Tue, Jul 16, 2013 at 8:24 AM, Sam Aaron <samaa...@gmail.com> wrote:

> Hi there,
>
> I'm trying to understand how the new core.async go blocks work in a single
> threaded environment such as Javascript. I'm slowly working through the
> implementation, but it's pretty hairy and tough going.
>
> My current question is how the inversion of control works. In David's
> (excellent) CSP blog post he demonstrated how you can have multiple go
> blocks running concurrently:
>
> (go (loop [] (<! (timeout 1000)) (>! c 2) (recur)))
> (go (loop [] (<! (timeout 1500)) (>! c 3) (recur)))
>
> I'm unsure how this interleaves with standard ClojureScript code. For
> example consider the following
>
> (go (loop [] (<! (timeout 1000)) (>! c 2) (recur)))
> (go (loop [] (<! (timeout 1500)) (>! c 3) (recur)))
>
> (loop [] (recur))
>
> Here, we have two go blocks followed by an infinite loop that's not in a
> go block. How does the code in the go blocks ever get 'unparked'?
>
> Sam
>
> ---
> http://sam.aaron.name
>
> --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.
>
>
>

-- 
-- 
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