www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - receiveOnly behavior

reply jdrewsen <jdrewsen nospam.com> writes:
import std.concurrency;

void main(string[] args) {
   receiveOnly!bool();
}



This simple program results in segmentation fault. I know i does not 
spawn a thread to receive anything from but is this the expected behavior?

/Jonas
May 04 2011
parent reply Sean Kelly <sean invisibleduck.org> writes:
On May 4, 2011, at 2:05 PM, jdrewsen wrote:

 import std.concurrency;
=20
 void main(string[] args) {
  receiveOnly!bool();
 }
=20
 This simple program results in segmentation fault. I know i does not =
spawn a thread to receive anything from but is this the expected = behavior? This was a known issue when calling receive() in the main thread before = ever calling thisTid(). Doing so seemed rather unlikely, but fixing = this was a trivial code change so I've just done so. Expect your sample = to not segfault in the next release.=
May 04 2011
parent Jonas Drewsen <jdrewsen nospam.com> writes:
On 05/05/11 01.31, Sean Kelly wrote:
 On May 4, 2011, at 2:05 PM, jdrewsen wrote:

 import std.concurrency;

 void main(string[] args) {
   receiveOnly!bool();
 }

 This simple program results in segmentation fault. I know i does not spawn a
thread to receive anything from but is this the expected behavior?
This was a known issue when calling receive() in the main thread before ever calling thisTid(). Doing so seemed rather unlikely, but fixing this was a trivial code change so I've just done so. Expect your sample to not segfault in the next release.
Thank you. /Jonas
May 05 2011