<br><br><div class="gmail_quote">On Tue, Apr 13, 2010 at 9:24 AM, Randal L. Schwartz <span dir="ltr">&lt;<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
&gt;&gt;&gt;&gt;&gt; &quot;Ang&quot; == Ang BeePeng &lt;<a href="mailto:beepeng86@yahoo.com">beepeng86@yahoo.com</a>&gt; writes:<br>
<br>
Ang&gt; Are Squeak processes pre-emptive? Are infinite loop processes safe<br>
Ang&gt; to run?<br>
<br>
Squeak uses a simple priority scheme.<br>
<br>
A Squeak process runs until it yields or it is interrupted by a higher<br>
priority process event.  When it is interrupted, it goes to the back of<br>
the queue, so when the higher priority process pauses or completes,<br>
other processes at the same priority are likely to be run instead.<br></blockquote><div><br></div><div>IMO the sending of the preempted process to the back of the queue is a bug.  It means one cannot rely on cooperative scheduling within a priority level.  On the other hand, if the VM does not send the preempted process to the back of the queue there is nothing to prevent a higher-priority process altering the run queues of lower priority processes, achieving the same thing.  But it is flexible if the scheduler code does it rather than the VM.  One can imagine per-process priorities being examined so that by default a process gets moved to the back of its run queue when preempted, but if a process has a &quot;don&#39;t preempt me&quot; property it is not.</div>
<div><br></div><div>FWIW VisualWorks has not moved preempted processes to the back of the run-queue since ObjectWorks 2.3, the last BlueBook compatible release.</div><div><br></div><div><br></div><div>best</div><div>Eliot</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
So, it&#39;s safe to run an infinite loop, but be sure that anything that<br>
should interrupt it is at a higher priority.  And if you&#39;re running<br>
*two* infinite loops at the same priority, you need something that will<br>
just interrupt regularly.<br>
<font color="#888888"><br>
--<br>
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095<br>
&lt;<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>&gt; &lt;URL:<a href="http://www.stonehenge.com/merlyn/" target="_blank">http://www.stonehenge.com/merlyn/</a>&gt;<br>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.<br>
See <a href="http://methodsandmessages.vox.com/" target="_blank">http://methodsandmessages.vox.com/</a> for Smalltalk and Seaside discussion<br>
<br>
</font></blockquote></div><br>