Using Fibers without yield

Unthread call at 3142.casa
Fri Nov 28 07:00:18 UTC 2025


Is there any reason for this behavior?
```D
import std.stdio, core.thread.fiber;

Fiber one, two;

void main() {
	one = new Fiber(
		delegate() {
			while(1) {
				stderr.writefln("one says two.state = %s", two.state);
				two.call();
			}
		}
	);
	two = new Fiber(
		delegate() {
			while(1) {
				stderr.writefln("two says one.state = %s", one.state);
				one.call();
			}
		}
	);
	one.call();
}
```
Execution of one is suspended when it calls two, but then two 
reports the state of one is not HOLD.
```
one says two.state = HOLD
two says one.state = EXEC
one says two.state = EXEC
Segmentation fault
```
Is this a bug or a feature? If the last then why?



More information about the Digitalmars-d-learn mailing list