<div dir="ltr">It is OK, I guess the output is just mixed</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 9, 2016 at 4:35 PM, miazo via Digitalmars-d-learn <span dir="ltr"><<a href="mailto:digitalmars-d-learn@puremagic.com" target="_blank">digitalmars-d-learn@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
The following simple program:<br>
<br>
import std.stdio, std.concurrency;<br>
<br>
void f1() {<br>
    writeln("owner: ", ownerTid);<br>
    writeln("worker: ", thisTid);<br>
}<br>
<br>
void main() {<br>
    writeln("owner: ", thisTid);<br>
    writeln("worker: ", spawn(&f1));<br>
}<br>
<br>
Gives me the following result:<br>
<br>
owner: Tid(18fd58)<br>
worker: Tid(18fd58)<br>
owner: Tid(24afe38)<br>
worker: Tid(24afe38)<br>
<br>
Is it correct? My expectation was that:<br>
- thisTid called from main will be the same as ownerTid called from f1<br>
- thisTid called from f1 will be the same as value returned by spawn()<br>
<br>
Thank you for your help.<br>
<br>
</blockquote></div><br></div>