<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:0 0 0 .8ex;border-left:1px #ccc 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:0 0 0 .8ex;border-left:1px #ccc 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><br></div><div>You are running the JIT right?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc 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></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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc 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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">
<div>At least that was my idea when I changed the code to use pthread_setschedprio. Changing the prio while keeping the policy seemed reasonable.</div></div></blockquote><div><br></div><div>If you can lower the priority of the main thread that&#39;ll work too.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">

<div>You /could/ try and implement the heartbeat in another process and use nice to change its priority.  I don&#39;t know how well that would work.  I&#39;ve never tried it.</div></div></div></div></blockquote>As I wrote I already wrote a simple C program that does send a SIGALRM. It’s working albeit very slowly.<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">

Second, I needed to change the implementation of ioUpdateVMTimezone because Solaris does not have time_t-&gt;tm_gmtoff.<br>
There seem to be copies of this function in all three heartbeat files with the one in sqUnixITimerHeartbeat.c working for those OS’s without<br>
tm_gmtoff.<br>
<br>
NativeBoost doesn’t seem to work yet (at least UnixEnvironment&gt;&gt;environ raises an error: „failed to get a symbol address: environ“).<br>
<br>
This VM gives me 686787391 bytecodes/sec and 80516849 sends/sec on my 6 years old Sun Ultra 24 (2,4GHz Intel Q9300).<br>
I get similar values for the VM with pthread_setschedparam call and superuser rights.<br>
My 4 years old iMac (2,8GHz Core i5) gives me 829149797 bytecodes/sec; 117122195 sends/sec.<br>
So the results seem comparable.<br>
<span><font color="#888888"><br>
Andreas</font></span> </blockquote></div>-- <br>best,<div>Eliot</div></div></div></blockquote></div><div>Regards,</div><div>Andreas</div></div></blockquote></div>-- <br>best,<div>Eliot</div>
</div></div>