Re: Can/should spawn work with functions that return?

2011-01-21 Thread Jonathan M Davis
On Friday, January 21, 2011 14:12:18 Andrej Mitrovic wrote: import std.stdio; import std.concurrency; void foo(int var) { } bool bar(int var) { return true; } void barWrapper(int var) { bar(var); } void main() { spawn(foo, 1); spawn(barWrapper, 1);

Re: Can/should spawn work with functions that return?

2011-01-21 Thread Andrej Mitrovic
Sorry, I should be careful with the word side-effects. What I meant was the newly spawned thread does its own job that the main thread doesn't care much about. It doesn't touch main's state or any shared variables. It does some work other than return a value. But the function I wanted the new

Re: Can/should spawn work with functions that return?

2011-01-21 Thread Jonathan M Davis
On Friday, January 21, 2011 15:23:37 Andrej Mitrovic wrote: Sorry, I should be careful with the word side-effects. What I meant was the newly spawned thread does its own job that the main thread doesn't care much about. It doesn't touch main's state or any shared variables. It does some work