<div dir="ltr">Hi Andreas,<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 23, 2014 at 9:35 AM, Andreas Wacknitz <span dir="ltr">&lt;<a href="mailto:a.wacknitz@gmx.de" target="_blank">a.wacknitz@gmx.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br><div style="word-wrap:break-word">Thanks again Eliot,<div>
<br></div><div>First, I solved the pthreads problem under OpenSolaris. While Solaris 10 doesn’t need special user privileges for thread control (at least within the same thread policy I guess),</div><div>users under Solaris 11 (and thus OpenSolaris) need the privilege „proc_priocntl“ to be given by an administrator.</div>
<div>(For those who are interested: usermod -K defaultpriv=basic,proc_priocntl andreas)</div></div></blockquote><div><br></div><div>This is a pain :-).  You could either assume that people can always get the necessary permission and go with the threaded heartbeat (my preferred suggestion) or provide two VMs (always tedious).</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>More below…<br>
</div><div><br><div><div>Am 22.04.2014 um 22:31 schrieb Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;:</div><br><blockquote type="cite"><div dir="ltr"><br><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Apr 22, 2014 at 1:10 PM, Andreas Wacknitz <span dir="ltr">&lt;<a href="mailto:a.wacknitz@gmx.de" target="_blank">a.wacknitz@gmx.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br><div style="word-wrap:break-word"><br><div><div>Am 22.04.2014 um 21:36 schrieb Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;:</div>

<br><blockquote type="cite"><div dir="ltr">Hi Andreas,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 22, 2014 at 12:05 PM, Andreas Wacknitz <span dir="ltr">&lt;<a href="mailto:a.wacknitz@gmx.de" target="_blank">a.wacknitz@gmx.de</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
This evening I further dealt with the problems on OpenSolaris (openindiana).<br>
I finally got a pthread version running without superuser rights. But I don’t know whether this will really work (ATM it does for me)<br>
because I removed the call to pthread_setschedparam in beatStateMachine leaving the heartbeat thread with the same<br>
priority than the vm thread. </blockquote><div><br></div><div>Alas, that will not work -(.  As soon as the image enters into a hard loop (e.g. [true] whileTrue) the heartbeat thread will be blocked and the VM will never break out of the loop.</div>

</div></div></div></blockquote><div><br></div>How can I check this blockage? I started the VM with --pollpipe 1 and then [true] whileTrue in a Workspace. The GUI is blocked but the pipe is still rotating.</div></div></blockquote>

<div><br></div><div>Can you interrupt with ctrl-period?  If not, then I don&#39;t understand how the pip is still rotating :-).  If you can, then you&#39;re not blocking the system.  Try e.g. [[true] whileTrue]  forkAt: Processor highestPriority.</div>
</div></div></div></blockquote>Yes, I can do that in both (with and without higher priority) BUT not when running this with highestPriority (again in BOTH versions!).</div></div></div></blockquote><div><br></div><div>Oops That&#39;s right.  It should be just &quot;[[true] whileTrue]  forkAt: Processor userPriority + 1&quot;.  Obviously one can&#39;t interrupt something running higher than userInterrupt priority.  Sorry, I was asleep.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div>
<blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>You are running the JIT right?<br></div></div></div></div></blockquote>How to tell for sure? </div></div></div></blockquote><div>
<br></div><div>vm -version</div><div><br></div><div>If it includes a CoInterpreter line you&#39;re running the JIT.  e.g.</div><div><div>McStalker.macbuild$ oscfvm -version</div><div>/Users/eliot/Cog/oscogvm/macbuild/Fast.app/Contents/MacOS/Squeak</div>
<div>4.0 4.0.2894 Mac OS X built on Apr 14 2014 17:02:16 Compiler: 4.2.1 (Apple Inc. build 5666) (dot 3) [Production VM]</div><div>CoInterpreter VMMaker.oscog-eem.674 uuid: eefd603d-9638-4ad8-99c0-4ee12e87d49d Apr 14 2014</div>
<div>StackToRegisterMappingCogit VMMaker.oscog-eem.674 uuid: eefd603d-9638-4ad8-99c0-4ee12e87d49d Apr 14 2014</div><div>VM: r2894 <a href="http://www.squeakvm.org/svn/squeak/branches/Cog">http://www.squeakvm.org/svn/squeak/branches/Cog</a> Date: 2014-04-14 15:32:11 -0700</div>
<div>Plugins: r2545 <a href="http://squeakvm.org/svn/squeak/trunk/platforms/Cross/plugins">http://squeakvm.org/svn/squeak/trunk/platforms/Cross/plugins</a></div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div>I started the VM with —trace. The last log is „IRBytecodeGenerator&gt;&gt;from:goto“.</div><div>The pipe is still rotating but ALT-. does not break the loop (maybe a problem of my Pharo image?; I will try later with a Squeak image).</div>
<div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><blockquote type="cite">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
I tried to replace the pthread_setschedparam call with a similar pthread_setschedprio call but<br>

with no luck (same problem: failed call with &quot;Not owner&quot;). I don’t know wether this is a general problem with the pthreads implementation<br>
on Solaris or just a problem with the gcc version (4.4.4) coming with the openindiana distribution I am using. Maybe this works only<br>
with the compilers and libraries that is delivered by Oracle (Solaris 10 ships with gcc 3.4.3; Solaris Studio has its own compilers).<br></blockquote><div><br></div><div>It&#39;s too do with pthreads.  Nothing to do with the compiler.  On some implementations it requires special permission to create threads with different priorities.  That used to be the case on linux and it appears to be the case on OpenSolaris.  Hence one is stuck with the itimer heartbeat.</div>

</div></div></div></blockquote>Is there any implementation actually using sqUnixITimerHeartbeat.c? </div></blockquote><div><br></div><div>Yes, but unhappily.  We use it at Cadence because we have customers on pre 2.6.12 kernels.  We have to e.g. switch off the heartbeast around certain external calls.</div>
</div></div></div></blockquote>I am still wondering about where the necessary sleep call will be generated in this case. I will check your latest VM sources. Maybe PharoVM is different here…</div></div></div></blockquote>
<div><br></div><div>Where is there a necessary sleep?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>I don’t think that Solaris has special problems here.</div>
<div>Also, I cannot imagine that this situation is so uncommon that nobody else got it before SqueakVM. A higher prioritized thread should be possible for ordinary users.</div>
</div></blockquote><div><br></div><div>I definitely wasn&#39;t the case on linux.</div><div><br></div></div></div></div></blockquote>I haven’t tried to build the VM for Solaris 10 yet but I have tried a multi-threaded example program I found in the web. This example program is running 4 threads for computation</div>
<div>and does not run under OpenSolaris (same error code like the SqueakVM is generating) but it runs without hassles on Solaris 10 SPARC. So I guess Solaris 10 will run the</div><div>two-threaded SqueakVM without problems.</div>
</div></div></blockquote><div><br></div><div>sigh...</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"></div></div></div></blockquote></div>Best regards,</div><div>Andreas</div><div><br></div>
</div><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>