Re: Thread join behaviour

2012-04-17 Thread Somedude
Le 17/04/2012 08:40, Russel Winder a écrit : > On Mon, 2012-04-16 at 21:03 +0200, Somedude wrote: > [...] > > Issue 7919 > > http://d.puremagic.com/issues/show_bug.cgi?id=7919 > Thanks.

Re: Thread join behaviour

2012-04-16 Thread Russel Winder
On Mon, 2012-04-16 at 21:03 +0200, Somedude wrote: [...] > Did you file a bug report ? If yes, which number ? This is an annoying > regression in my opinion. Issue 7919 http://d.puremagic.com/issues/show_bug.cgi?id=7919 -- Russel.

Re: Thread join behaviour

2012-04-16 Thread Somedude
Le 15/04/2012 20:40, Russel Winder a écrit : > On Sun, 2012-04-15 at 16:04 +0200, Artur Skawina wrote: > [...] >> (my old GDC needs the explicit "function", no idea if newer >> frontends still require that) > > OK, works for me with GDC as well, DMD is broken! I'll file a bug > report. > Did you

Re: Thread join behaviour

2012-04-16 Thread Russel Winder
On Sun, 2012-04-15 at 23:36 +0200, Somedude wrote: [...] > It works here (DMD 2.058 win32), even without "function". It also works for me with 2.058 on x86_64 Linux. So the conclusion is that 2.059 is broken. I'll update the issue I set up for this. -- Russel. ===

Re: Thread join behaviour

2012-04-15 Thread Somedude
Le 15/04/2012 20:40, Russel Winder a écrit : > On Sun, 2012-04-15 at 16:04 +0200, Artur Skawina wrote: > [...] >> (my old GDC needs the explicit "function", no idea if newer >> frontends still require that) > > OK, works for me with GDC as well, DMD is broken! I'll file a bug > report. > It work

Re: Thread join behaviour

2012-04-15 Thread Russel Winder
On Sun, 2012-04-15 at 16:04 +0200, Artur Skawina wrote: [...] > (my old GDC needs the explicit "function", no idea if newer > frontends still require that) OK, works for me with GDC as well, DMD is broken! I'll file a bug report. -- Russel. ===

Re: Thread join behaviour

2012-04-15 Thread Artur Skawina
On 04/15/12 15:55, Russel Winder wrote: > On Sat, 2012-04-14 at 23:25 +0200, Artur Skawina wrote: > [...] >> >> 'threads' is a (lazy) range; >> >>auto threads = array(map ! ( ( int a ) { >>void delegate ( ) f ( ) { >> return delegate ( ) { writeln ( a )

Re: Thread join behaviour

2012-04-15 Thread Russel Winder
On Sat, 2012-04-14 at 23:27 +0200, Somedude wrote: [...] > This works: > > int main ( immutable string[] args ) { > > auto threadgroup = new ThreadGroup(); > > void delegate ( ) f (int a ) { > return delegate ( ) { writeln ( a ) ; } ; > } > > for ( int n = 0; n < 10; n++ ) { > t

Re: Thread join behaviour

2012-04-15 Thread Russel Winder
On Sat, 2012-04-14 at 17:10 -0400, Matt Soucy wrote: [...] > If you merge the two foreach loops into one, doing t.start();t.join(); > it doesn't have this issue. Also, when I run your code repeatedly the > number of successful numbers printed changes a lot. > I'm assuming that you're trying to jo

Re: Thread join behaviour

2012-04-15 Thread Russel Winder
On Sat, 2012-04-14 at 23:25 +0200, Artur Skawina wrote: [...] > > 'threads' is a (lazy) range; > >auto threads = array(map ! ( ( int a ) { >void delegate ( ) f ( ) { > return delegate ( ) { writeln ( a ) ; } ; >} >retu

Re: Thread join behaviour

2012-04-14 Thread Somedude
Le 14/04/2012 18:04, Russel Winder a écrit : > I thought the following would terminate gracefully having printed 0..9 > in some (random) order: > > #! /usr/bin/env rdmd > > import std.algorithm ; > import std.range ; > import std.stdio ; > import co

Re: Thread join behaviour

2012-04-14 Thread Artur Skawina
On 04/14/12 18:04, Russel Winder wrote: > I thought the following would terminate gracefully having printed 0..9 > in some (random) order: > > #! /usr/bin/env rdmd > > import std.algorithm ; > import std.range ; > import std.stdio ; > import core.th

Re: Thread join behaviour

2012-04-14 Thread Matt Soucy
On 04/14/2012 04:56 PM, Alex Rønne Petersen wrote: On 14-04-2012 18:04, Russel Winder wrote: I thought the following would terminate gracefully having printed 0..9 in some (random) order: #! /usr/bin/env rdmd import std.algorithm ; import std.range ; import std.stdio ; import core.thread ; in

Re: Thread join behaviour

2012-04-14 Thread Alex Rønne Petersen
On 14-04-2012 18:04, Russel Winder wrote: I thought the following would terminate gracefully having printed 0..9 in some (random) order: #! /usr/bin/env rdmd import std.algorithm ; import std.range ; import std.stdio ; import core.thread ;