| Thread overview | |||||
|---|---|---|---|---|---|
|
May 11, 2012 std.concurrency and module constructors | ||||
|---|---|---|---|---|
| ||||
OS: Windows 7 64bit
Compiler: DMD32 D Compiler v2.059
Using spawn in module constructor causes very strange behavior.
import std.concurrency;
import std.stdio;
void main() {
}
void worker() {
receiveOnly!OwnerTerminated;
}
static this() {
writeln("module constructor");
spawn(&worker);
}
static ~this() {
writeln("module destructor");
}
prints in console:
module constructor
module destructor
module constructor
module destructor
module constructor
module constructor
module constructor
module constructor
module constructor
...
| ||||
May 11, 2012 Re: std.concurrency and module constructors | ||||
|---|---|---|---|---|
| ||||
Posted in reply to japplegame | On Fri, 11 May 2012 07:34:46 -0400, japplegame <japplegame@gmail.com> wrote:
> OS: Windows 7 64bit
> Compiler: DMD32 D Compiler v2.059
>
> Using spawn in module constructor causes very strange behavior.
>
> import std.concurrency;
> import std.stdio;
> void main() {
> }
> void worker() {
> receiveOnly!OwnerTerminated;
> }
> static this() {
> writeln("module constructor");
> spawn(&worker);
> }
> static ~this() {
> writeln("module destructor");
> }
>
> prints in console:
>
> module constructor
> module destructor
> module constructor
> module destructor
> module constructor
> module constructor
> module constructor
> module constructor
> module constructor
> ...
This list is for bugzilla to post to, it is not for general bug reports or help requests. I really wish it was disabled to post to from everyone but bugzilla.
Please repost your issue to D.learn.
Thanks
-Steve
| |||
May 11, 2012 Re: std.concurrency and module constructors | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | Oh, I'm sorry. My mistake. | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply