<br><br><div class="gmail_quote">On Thu, Jan 12, 2012 at 10:23 AM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div class="h5">On 12.01.2012, at 16:59, Bert Freudenberg wrote:<br>
<br>
&gt; On 12.01.2012, at 15:53, Levente Uzonyi wrote:<br>
&gt;<br>
&gt;&gt; On Tue, 10 Jan 2012, Bert Freudenberg wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; On Mon, 9 Jan 2012, Bert Freudenberg wrote:<br>
&gt;&gt;&gt;&gt; It&#39;s more important to be correct than to be fast - and I agree finding pointers is its main purpose, so your fix looks like an improvement.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Speaking of correctness: the pointer finder does not find an object that is held only by a process. Can we fix this?<br>
&gt;&gt;<br>
&gt;&gt; Can provide an example?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Levente<br>
&gt;<br>
&gt;<br>
&gt; | object |<br>
&gt; object := {0}.<br>
&gt; [<br>
&gt;       | objRef |<br>
&gt;       objRef := object.<br>
&gt;       [<br>
&gt;               objRef at: 1 put: (objRef at: 1) + 1.<br>
&gt;               Transcript show: objRef first; cr.<br>
&gt;               (Delay forSeconds: 1) wait.<br>
&gt;       ] repeat.<br>
&gt; ] forkNamed: &#39;Ref Test&#39;.<br>
&gt; object explorePointers.<br>
&gt; object := nil.<br>
&gt;<br>
&gt; Initially, the explorer will find two objects pointing to the array - one is from the outer closure of the doIt, the other is the PointerExplorer itself. If you then toggle the array in the explorer, only one reference remains, from the explorer.<br>

&gt;<br>
&gt; Use the process browser to kill the process. Or before that, try to find references to the process itself from the browser&#39;s &quot;inspect pointers&quot; item. It seems to be held by a Semaphore, but nothing appears to hold the Semaphore.<br>

&gt;<br>
&gt; - Bert -<br>
<br>
<br>
</div></div>Okay, false alarm, I understand now what&#39;s going on.<br>
<br>
The pointer finder works fine if I increase the time of the delay. The problem is that &quot;Delay forSeconds: 1&quot; creates a semaphore that holds onto the process, but it&#39;s gone after each second. Classical race condition - by the time the pointer finder is looking for the reference, it is already obsolete.<br>

<br>
This is even worse in my original problem which had a process polling 50 times per second. Very hard to catch that.<br>
<br>
A workaround would be to run the pointer finder on a very high priority level ...<br></blockquote><div><br></div><div>I doubt this will work.  The system won;t be responsive while something as compute-intensive as the pointer finder runs if it does so at high priority.  What if one took a snapshot of the runnable processes at high-priority, at the start of searching for pointers?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<font color="#888888"><br>
- Bert -<br>
<br>
<br>
<br>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>