From: Will Duquette on
Has anyone who understands Tcl 8.6 coroutines looked at Google's new
"Go" language and its "goroutines"? (http://golang.org).

From the little I know, it seems to me that Tcl 8.6 could support a
very similar model of concurrency.
From: jima on
On 12 nov, 19:28, Will Duquette <w...(a)wjduquette.com> wrote:
> Has anyone who understands Tcl 8.6 coroutines looked at Google's new
> "Go" language and its "goroutines"?  (http://golang.org).
>
> From the little I know, it seems to me that Tcl 8.6 could support a
> very similar model of concurrency.

Well, the other day I posted a similar comment on the wiki page for
coroutine and DKF answered

"...but it looks like what they're really doing is lightweight
threads, not coroutines. We might want to suggest “borrowing” their
channel abstraction though; it's a model that works really well."

jima
From: Donal K. Fellows on
On 12 Nov, 18:28, Will Duquette <w...(a)wjduquette.com> wrote:
> Has anyone who understands Tcl 8.6 coroutines looked at Google's new
> "Go" language and its "goroutines"?  (http://golang.org).
>
> From the little I know, it seems to me that Tcl 8.6 could support a
> very similar model of concurrency.

They're not the same thing. Though there are some similarities,
goroutines are parallel-schedulable and so are more like threads than
coroutines (they are actually done as green threads over a native
thread pool). There is a yield-like operation, but that's actually
sending messages over a channel. They've still got a shared state
model, though with some fairly grisly constraints on observability of
state changes.

Donal.
From: Will Duquette on
On Nov 12, 4:28 pm, "Donal K. Fellows"
<donal.k.fell...(a)manchester.ac.uk> wrote:
> On 12 Nov, 18:28, Will Duquette <w...(a)wjduquette.com> wrote:
>
> > Has anyone who understands Tcl 8.6 coroutines looked at Google's new
> > "Go" language and its "goroutines"?  (http://golang.org).
>
> > From the little I know, it seems to me that Tcl 8.6 could support a
> > very similar model of concurrency.
>
> They're not the same thing. Though there are some similarities,
> goroutines are parallel-schedulable and so are more like threads than
> coroutines (they are actually done as green threads over a native
> thread pool). There is a yield-like operation, but that's actually
> sending messages over a channel. They've still got a shared state
> model, though with some fairly grisly constraints on observability of
> state changes.
>
> Donal.

Though it appears from their docs that they discourage using shared
state to communicate between goroutines.

But yes, it's clear that Tcl coroutines and goroutines are different.
My question was really, could we do essentially the same thing as
goroutines and Go chans on top of Tcl coros. And would that be worth
doing?
From: Andreas Otto on
Will Duquette wrote:

> Has anyone who understands Tcl 8.6 coroutines looked at Google's new
> "Go" language and its "goroutines"? (http://golang.org).
>
> From the little I know, it seems to me that Tcl 8.6 could support a
> very similar model of concurrency.

Tcl already has the technology called "libmsgque"

-> http://wiki.tcl.tk/11548

you can create a tcl CO process using fork, thread or spawn

->
http://libmsgque.sourceforge.net/tclmsgque/group__tclmsgque.htm#tcl_slave

and this work for all supported programming-languages


mfg

Andreas Otto (aotto1968)


 |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9
Prev: tcl ssh extension library?
Next: Expect spawn expect