<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>Hi,</DIV><DIV><BR class="khtml-block-placeholder"></DIV>Sorry, for the last question! I solved it just after posting.  In the compiled version of the code I sent the process terminated before the thread got a chance to execute the display... I added a (thread-sleep! 1)  at the end and I saw the message appear.<DIV><BR class="khtml-block-placeholder"></DIV><DIV>I will look further in my code to see why I am not getting the expected outputs in the console from my threads... </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Francois Magnan</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"><DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><DIV><DIV>On 07-04-23, at 12:27, Francois Magnan wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><O:SMARTTAGTYPE namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"> <DIV class="Section1"><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">Hi,<O:P></O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial"><O:P> </O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">I have a strange problem with input/output and threads using GambitC-4b22 (WinXP/MINGW). I tried to isolate it.<O:P></O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">It can be basically reproduced by running the following code in the interpreter:<O:P></O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial"><O:P> </O:P></SPAN></FONT></P><P class="MsoNormal" style="text-autospace:none"><FONT size="2" color="black" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new";="" color:black;background:white"="">(<B><SPAN style="font-weight:bold">define</SPAN></B> (main)</SPAN></FONT><FONT size="2" face="Courier New"><SPAN style="font-size: 10.0pt;font-family:" courier="" new""=""><O:P></O:P></SPAN></FONT></P><P class="MsoNormal" style="text-autospace:none"><FONT size="2" color="black" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new";="" color:black;background:white"="">  (</SPAN></FONT><B><FONT size="2" color="blue" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new";="" color:blue;background:white;font-weight:bold"="">let</SPAN></FONT></B><FONT size="2" color="black" face="Courier New"><SPAN style="font-size:10.0pt;font-family: " courier="" new";color:black;background:white"=""> ((t (make-thread</SPAN></FONT><FONT size="2" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new""=""><O:P></O:P></SPAN></FONT></P><P class="MsoNormal" style="text-autospace:none"><FONT size="2" color="black" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new";="" color:black;background:white"="">            (</SPAN></FONT><B><FONT size="2" color="blue" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new";="" color:blue;background:white;font-weight:bold"="">lambda</SPAN></FONT></B><FONT size="2" color="black" face="Courier New"><SPAN style="font-size:10.0pt;font-family: " courier="" new";color:black;background:white"=""> ()</SPAN></FONT><FONT size="2" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new""=""><O:P></O:P></SPAN></FONT></P><P class="MsoNormal" style="text-autospace:none"><FONT size="2" color="black" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new";="" color:black;background:white"="">              (display </SPAN></FONT><FONT size="2" color="#606060" face="Courier New"><SPAN style="font-size:10.0pt; font-family:" courier="" new";color:#606060;background:white"="">"\n\n\n hello world!\n\n\n"</SPAN></FONT><FONT size="2" color="black" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new";color:black;background:white"="">)</SPAN></FONT><FONT size="2" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new""=""><O:P></O:P></SPAN></FONT></P><P class="MsoNormal" style="text-autospace:none"><FONT size="2" color="black" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new";="" color:black;background:white"="">              (force-output)))))</SPAN></FONT><FONT size="2" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new""=""><O:P></O:P></SPAN></FONT></P><P class="MsoNormal" style="text-autospace:none"><FONT size="2" color="black" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new";="" color:black;background:white"="">    (thread-start! t)))</SPAN></FONT><FONT size="2" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new""=""><O:P></O:P></SPAN></FONT></P><P class="MsoNormal" style="text-autospace:none"><FONT size="2" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new""=""><O:P> </O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" color="black" face="Courier New"><SPAN style="font-size:10.0pt;font-family:" courier="" new";color:black;background:white"="">(main)</SPAN></FONT><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt;font-family:Arial"> <O:P></O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial"><O:P> </O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial"><O:P> </O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">Which does the expected thing: display the “hello world” message in the console.<O:P></O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">If I compile the above program to an executable it doesn’t display the message anymore.<O:P></O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial"><O:P> </O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">In my real context, I am using a mutex and many threads are writing a trace to the console. In the compiled version I get no traces…<O:P></O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial"><O:P> </O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">What am I missing?<O:P></O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">Thank you,<O:P></O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial"><O:P> </O:P></SPAN></FONT></P><P class="MsoNormal"><ST1:PERSONNAME w:st="on"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt;font-family:Arial">Francois Magnan</SPAN></FONT></ST1:PERSONNAME><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt;font-family:Arial"><O:P></O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial"><O:P> </O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial"><O:P> </O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial"><O:P> </O:P></SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial"><O:P> </O:P></SPAN></FONT></P> </DIV> </O:SMARTTAGTYPE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Gambit-list mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</A></DIV> </BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BODY></HTML>