Re: Channels for tasks?

2013-07-23 Thread Sean Kelly
On Jul 22, 2013, at 11:20 PM, deadalnix wrote: > On Monday, 22 July 2013 at 18:24:53 UTC, Sean Kelly wrote: >> I think this would most likely happen within std.concurrency, with the >> context switch occurring on send/receive. > > If so, other libraries won't be able to yield (for instance libr

Re: Channels for tasks?

2013-07-23 Thread Dejan Lekic
On Friday, 19 July 2013 at 07:42:26 UTC, deadalnix wrote: On Thursday, 18 July 2013 at 17:55:36 UTC, Sean Kelly wrote: On Jul 18, 2013, at 8:28 AM, Matt wrote: Hi guys, I know this will have probably been answered before, but does D have a concept similar to Go's channels when it comes to t

Re: Channels for tasks?

2013-07-22 Thread deadalnix
On Monday, 22 July 2013 at 18:24:53 UTC, Sean Kelly wrote: I think this would most likely happen within std.concurrency, with the context switch occurring on send/receive. If so, other libraries won't be able to yield (for instance libraries performing IO).

Re: Channels for tasks?

2013-07-22 Thread Sean Kelly
On Jul 18, 2013, at 11:35 PM, Jacob Carlborg wrote: > On 2013-07-18 21:08, Sean Kelly wrote: > >> We already do in-library TLS for OSX and so it shouldn't be terribly >> difficult to use this logic for fibers, but things get tricky once you >> consider dynamic libraries. > > To be able to sup

Re: Channels for tasks?

2013-07-22 Thread Sean Kelly
On Jul 19, 2013, at 12:48 AM, deadalnix wrote: > On Thursday, 18 July 2013 at 19:08:25 UTC, Sean Kelly wrote: >> Functionally, fibers are coroutines. They have their own stack and execute >> within the context of the calling thread. Most languages that scale to >> thousands or millions of con

Re: Channels for tasks?

2013-07-19 Thread deadalnix
On Thursday, 18 July 2013 at 19:08:25 UTC, Sean Kelly wrote: Functionally, fibers are coroutines. They have their own stack and execute within the context of the calling thread. Most languages that scale to thousands or millions of concurrent threads/processes use fibers (often called "green

Re: Channels for tasks?

2013-07-19 Thread deadalnix
On Thursday, 18 July 2013 at 17:55:36 UTC, Sean Kelly wrote: On Jul 18, 2013, at 8:28 AM, Matt wrote: Hi guys, I know this will have probably been answered before, but does D have a concept similar to Go's channels when it comes to tasks? I believe (according to a few forum posts hinting a

Re: Channels for tasks?

2013-07-18 Thread Jacob Carlborg
On 2013-07-18 21:08, Sean Kelly wrote: We already do in-library TLS for OSX and so it shouldn't be terribly difficult to use this logic for fibers, but things get tricky once you consider dynamic libraries. To be able to support dynamic libraries and TLS on Mac OS X we will most likely need

Re: Channels for tasks?

2013-07-18 Thread Sean Kelly
On Jul 18, 2013, at 11:38 AM, "Matt" wrote: > On Thursday, 18 July 2013 at 17:55:36 UTC, Sean Kelly wrote: >> Not as such. I'd like to make Fibers each have their own message queue in >> std.concurrency, but that means making TLS work at the fiber level, which is >> tricky. >> >> I think ther

Re: Channels for tasks?

2013-07-18 Thread Mr. Anonymous
On Thursday, 18 July 2013 at 18:38:57 UTC, Matt wrote: On Thursday, 18 July 2013 at 17:55:36 UTC, Sean Kelly wrote: Not as such. I'd like to make Fibers each have their own message queue in std.concurrency, but that means making TLS work at the fiber level, which is tricky. I think there is

Re: Channels for tasks?

2013-07-18 Thread Matt
On Thursday, 18 July 2013 at 16:41:34 UTC, Jesse Phillips wrote: I don't think this is really an answer, but awhile back I was looking into the difference of D and Go for parallel/concurrency and created these two examples[1][2] from the blog http://www.mprescient.com/journal/2011/1/9/concurr

Re: Channels for tasks?

2013-07-18 Thread Matt
On Thursday, 18 July 2013 at 17:55:36 UTC, Sean Kelly wrote: Not as such. I'd like to make Fibers each have their own message queue in std.concurrency, but that means making TLS work at the fiber level, which is tricky. I think there is value in the CSP model (ie. channels), but haven't done

Re: Channels for tasks?

2013-07-18 Thread Sean Kelly
On Jul 18, 2013, at 8:28 AM, Matt wrote: > Hi guys, > I know this will have probably been answered before, but does D have a > concept similar to Go's channels when it comes to tasks? > > I believe (according to a few forum posts hinting at it) that such a thing > exists for threads, but not f

Re: Channels for tasks?

2013-07-18 Thread Jesse Phillips
On Thursday, 18 July 2013 at 15:29:00 UTC, Matt wrote: Hi guys, I know this will have probably been answered before, but does D have a concept similar to Go's channels when it comes to tasks? I don't think this is really an answer, but awhile back I was looking into the difference of D and Go

Channels for tasks?

2013-07-18 Thread Matt
Hi guys, I know this will have probably been answered before, but does D have a concept similar to Go's channels when it comes to tasks? I believe (according to a few forum posts hinting at it) that such a thing exists for threads, but not for the lightweight tasks provided by std.parallelism