Prev: tcl ssh extension library?
Next: Expect spawn expect
From: Will Duquette on 12 Nov 2009 13:28 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 12 Nov 2009 14:47 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 12 Nov 2009 19:28 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 12 Nov 2009 23:10 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 13 Nov 2009 02:22
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) |