<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>Am 24.04.2014 um 00:14 schrieb Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:</div><br class="Apple-interchange-newline"><blockquote type="cite"><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">&nbsp;<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 :-). &nbsp;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></div></div></blockquote>Yes, I consider going with the threaded heartbeat for OpenSolaris (I will also try to compile everything under Solaris 11.1 but that’s on lower priority for me as I am not really using it.).</div><div>I am not yet decided whether the version without increased priority would be enough. At the moment everything seems to run fine with this version; I can interrupt "[[true] whileTrue] forkAt: Processor userInterruptPriority“</div><div>by ALT-.</div><div>But the whole thing isn’t finished yet as FFI (NativeBoost doesn’t seem to work (e.g. "UnixEnvironment environ“ fails. I don’t know when I will find time to deal with that.</div><div><br></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; position: static; z-index: auto;"><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; position: static; z-index: auto;">&nbsp;<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; position: static; z-index: auto;"><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 -(. &nbsp;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? &nbsp;If not, then I don't understand how the pip is still rotating :-). &nbsp;If you can, then you're not blocking the system. &nbsp;Try e.g. [[true] whileTrue] &nbsp;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's right. &nbsp;It should be just "[[true] whileTrue] &nbsp;forkAt: Processor userPriority + 1". &nbsp;Obviously one can't interrupt something running higher than userInterrupt priority. &nbsp;Sorry, I was asleep.</div></div></div></div></blockquote>See above. OpenSolaris seems to run fine with the two threads having the same priority.</div><div><br></div><div><div><br></div></div><div><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; position: static; z-index: auto;"><div style="word-wrap:break-word">
<blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">You are running the JIT right?<br></div></div></div></blockquote>How to tell for sure? </div></blockquote><div>
<br></div><div>vm -version</div><div><br></div><div>If it includes a CoInterpreter line you're running the JIT. &nbsp;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></div></blockquote><div><div>merkur pharo-without-higher-priority $ ./pharo --version</div><div>3.9-7 #1 22. April 2014 20:30:39 CEST gcc 4.7.3 [Production VM]</div><div>NBCoInterpreter NativeBoost-CogPlugin-GuillermoPolito.19 uuid: acc98e51-2fba-4841-a965-2975997bba66 Apr 22 2014</div><div>NBCogit NativeBoost-CogPlugin-GuillermoPolito.19 uuid: acc98e51-2fba-4841-a965-2975997bba66 Apr 22 2014</div><div><a href="https://github.com/pharo-project/pharo-vm.git">https://github.com/pharo-project/pharo-vm.git</a> Commit: 9e648898f53aadb692f2dc95f432daedc449d432 Date: 2014-04-09 16:01:20 +0200 By: Esteban Lorenzano &lt;<a href="mailto:estebanlm@gmail.com">estebanlm@gmail.com</a>&gt;&nbsp;</div><div>SunOS merkur 5.11 illumos-b6240e8 i86pc i386 i86pc</div><div>plugin path: /home/andreas/bin/pharo-without-higher-priority/ [default: /home/andreas/bin/pharo-without-higher-priority/]</div><div><br></div></div><div><br></div><div>What does this tell?</div><div><br></div><div><br></div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>&nbsp;</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; position: static; z-index: auto;">
<div style="word-wrap:break-word"><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 "Not owner"). 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's too do with pthreads. &nbsp;Nothing to do with the compiler. &nbsp;On some implementations it requires special permission to create threads with different priorities. &nbsp;That used to be the case on linux and it appears to be the case on OpenSolaris. &nbsp;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. &nbsp;We use it at Cadence because we have customers on pre 2.6.12 kernels. &nbsp;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></blockquote>
<div><br></div><div>Where is there a necessary sleep?</div></div></div></div></blockquote>My understanding is that the interrupt handler for the heartbeat is waiting for SIGALRM. Typically this is emitted by an expiring usleep or nanosleep call. I cannot see one in the code that is active</div><div>when compiling the pharo-vm with ITIMER_HEARTBEAT flag set. In case that VM_TICKER flag is set there is an nanosleep call in the corresponding code.</div><div><br></div><div>The fact that my ITIMER_HEARTBEAT version is running when external SIGALRM’s being triggered confirms my view that a source for this signal is missing.</div><div><br></div><div>Best regards,</div><div>Andreas</div><div><br></div></body></html>