Possible to pass a member function to spawn?

2012-02-06 Thread Oliver Puerto
Hello, I'm very new to D. Just started reading "The D programming language". I should read it from beginning to end before posting questions here. I know ... But I'm just too impatient. The issue seems not to be that simple, nevertheless. The code below compiles with Visual Studio. I want to h

Output to console from DerivedThread class strange

2012-02-07 Thread Oliver Puerto
Hello, I have a question concerning threading. I use Visual Studio with the Visual-D plugin. The problem is somehow that when executing the code below "Derived thread running." is displayed 3 times on the console but not before "return 0" is reached. Then "Derived thread running." is displayed

Re: Output to console from DerivedThread class strange

2012-02-07 Thread Oliver Puerto
er, with all sleeps > commented out; the 3 prints will happen after the program exits (it will > take some time before the main thread yields to the new created threads) > .. > if you uncomment any of those sleeps, all prints coming before it will > print at that time... > > On

Re: Possible to pass a member function to spawn?

2012-02-08 Thread Oliver Puerto
un(msg); }, (Tid sender, string msg) { checkShutdown(sender, msg); }, (Variant v) { writeln("huh?"); } ); } } Original-Nachricht > Datum: Mon, 06 Feb 2012 22:38:03 +0100 > Von: "Oliver Puerto" > An: digit

Re: Output to console from DerivedThread class strange

2012-02-08 Thread Oliver Puerto
rivedThread dt2 = new DerivedThread(); >dt2.start(); > >DerivedThread dt3 = new DerivedThread(); >dt3.start(); > >for(int i=0; i<100; ++i) > writeln("tick"); > >Thread.sleep(dur!("seconds")( 4 )); >return 0;