Hi!<div><br /></div><div><br /></div><div>> <span style="font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">On wow64, threads run a mix of 32bit and 64bit code.</span></div><div><span style="font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt"><br /></span></div><div><span style="font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">Yes, it's true ...</span></div><div><span style="font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt"><br /></span></div><div><span style="font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">But today ( "in a modern world") wow64 is most usual way of using 32bit software.</span></div><div><span style="font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt"><br /></span></div><div><br /></div><div>Can "coop variant M3" works as "Go language software" i.e. 1 "OS thread" per 1 CPU Core?</div><div><br /></div><div>(</div><div> </div><div>In this case we can use 100% CPU cores even in cooperative mode of Modula-3</div><div><br /></div><div>( Of course, "near 100%". It's depends OS settings for processes priority, etc. )</div><div><br /></div><div>)</div><div><br /></div><div><br /></div><div>Best regards, Victor Miasnikov<br /><br /><div>05.06.2019, 12:21, "Jay K" <jayk123@hotmail.com>:</div><blockquote><div><div dir="ltr">
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
Native systems work fine.</div>
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
<br />
</div>
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
On wow64, threads run a mix of 32bit and 64bit code.</div>
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
It isn't clear what happens if you suspend and get context while in 64bit.</div>
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
<br />
</div>
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
AMD64_NT I think is in decent condition.</div>
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
So there is an argument to just not support running on wow64.</div>
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
<br />
</div>
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
Coop would still provide, I think, a more portable system.</div>
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
Albeit larger code, with the polling.</div>
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
A little less responsive, since polling wouldn't be every instruction, etc.</div>
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
<br />
</div>
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
- Jay</div>
<div>
<div id="ecb48a84978ba82d19f38f503728fa2df57c4cd2cbe3a3013704952ac0565d73appendonsend"></div>
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
<br />
</div>
<hr style="display:inline-block;width:98%" />
<div dir="ltr" id="ca2944a1601373f79e11027eba6e57c3143d95406757383ab92f9b574181a7d8divRplyFwdMsg"><font color="#000000" face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b> <a class="09f7ddcd78d17c479368795f67fe4443goto-anchor" href="mailto:vvm@tut.by">vvm@tut.by</a> <<a class="09f7ddcd78d17c479368795f67fe4443goto-anchor" href="mailto:vvm@tut.by">vvm@tut.by</a>><br />
<b>Sent:</b> Wednesday, June 5, 2019 9:03 AM<br />
<b>To:</b> Jay K; <a class="09f7ddcd78d17c479368795f67fe4443goto-anchor" href="mailto:M3devel@elegosoft.com">M3devel@elegosoft.com</a><br />
<b>Subject:</b> Re: [M3devel] cooperative suspend?</font>
<div> </div>
</div>
<div>Hi!
<div><br />
</div>
<div><br />
</div>
<div>I think additional information needs:</div>
<div><br />
</div>
<div>1) What happened on pure 32bit Windows? </div>
<div>( and inside VM on Hyper-V? )</div>
<div><br />
</div>
<div>2) What happened with AMD64_NT Modula-3 ?</div>
<div><br />
</div>
<div><br />
</div>
<div><br />
</div>
<div>Best regards, Victor Miasnikov </div>
<div><br />
<br />
<div>05.06.2019, 08:38, "Jay K" <<a class="09f7ddcd78d17c479368795f67fe4443goto-anchor" href="mailto:jayk123@hotmail.com">jayk123@hotmail.com</a>>:</div>
<blockquote>
<div>
<div dir="ltr">
<div style="color:rgb( 0 , 0 , 0 );font-family:'calibri' , 'helvetica' , sans-serif;font-size:12pt">
SupendThread = GetThreadContext on wow64 make me nervous.<br />
<div></div>
<div>It doesn't really work as you might expect, and may or may</div>
<div>not be viable.</div>
<div></div>
<div>CoreCLR uses underdocumented flags with them, but isn't just</div>
<div>looking for roots. It is looking for a context it can change.</div>
<div>I therefore don't want to just copy it.</div>
<div>Maybe if we look closer?</div>
<div></div>
<div>The analogous code on PPC_DARWIN fails on x86. Obscure, I realize.</div>
<div></div>
<div>Thoughts:</div>
<div> 1. Ignore PPC_DARWIN? </div>
<div> 2. Find the larger truths around x86 context on wow64? </div>
<div> 3. Deprecate anything under wow64? </div>
<div> 4. Developer a cooperative suspend model? </div>
<div></div>
<div>Let's delve into the last?</div>
<div>I only understand it somewhat.</div>
<div></div>
<div>Cooperative suspend involves no more signals and OS-level</div>
<div>thread suspension, but polling, at function entry, and in loops.</div>
<div></div>
<div>This is nice as it removes a bunch of platform-dependent code</div>
<div>and helps debuggability (don't have to ignore those signals).</div>
<div></div>
<div>How does cooperative suspend interact with calls out to C?</div>
<div>And with callbacks?</div>
<div></div>
<div>A thread that calls out to C, has to save some state (nonvolatile</div>
<div>registers and stack pointer) and mark itself some how?</div>
<div></div>
<div>and if there are callbacks? How does that work?</div>
<div>The marking nests and unnests?</div>
<div></div>
<div>As I understand the mainline Java implementation is cooperatively suspended.</div>
<div>So it must be possible/easy?</div>
<div><br />
</div>
<div> - Jay</div>
<div></div>
<br />
</div>
</div>
</div>
<div>
<p style="margin-bottom:0;margin-top:0">_______________________________________________<br />
M3devel mailing list<br />
<a class="2b849f61542851c59468259139ce68fd944795b21e646a1207b678baf81afa3ex_09f7ddcd78d17c479368795f67fe4443goto-anchor 09f7ddcd78d17c479368795f67fe4443goto-anchor" href="mailto:M3devel@elegosoft.com">M3devel@elegosoft.com</a><br />
<a class="2b849f61542851c59468259139ce68fd944795b21e646a1207b678baf81afa3ex_09f7ddcd78d17c479368795f67fe4443goto-anchor 09f7ddcd78d17c479368795f67fe4443goto-anchor" href="https://m3lists.elegosoft.com/mailman/listinfo/m3devel">https://m3lists.elegosoft.com/mailman/listinfo/m3devel</a><br />
</p>
</div>
</blockquote>
<div><br />
</div>
<div><br />
</div>
<div class="8cff1395c8b98652bbcfca324bccf93bdaf2640750100f2a8e6d0750f76ad777x_fac59074051ae5ed40c8811da5d24da6js-compose-signature"></div>
<div><br />
</div>
</div>
</div>
</div>
</div></div></blockquote><div><br /></div><div><br /></div><div class="fac59074051ae5ed40c8811da5d24da6js-compose-signature"></div><div><br /></div></div>