<div dir="ltr">Hi Craig,<div><br></div><div>    so the code in tryLockVMOwner is</div><div>        mov $1, %eax</div><div>        mfence</div><div>        xchg %eax, vmOwnerLock</div><div>        sfence</div><div>        sub $1, %eax    &quot;Since we only ever set the lock to 1 or 0, subtracting 1 sets EAX to 0 if the lock was already locked and non-zero if it wasn&#39;t.&quot;</div><div>        ret</div><div><br></div><div>i.e. it attempts to set vmOwnerLock and answers if the attempt succeeded, where it will only succeed if vmOwnerLock was zero.  So I guess the system is never arranging to unlock the Vm so there is never any opportunity for the foreign callback to get entry.  Try adding an occasional &quot;Processor relinquishProcessorForMicroseconds: 100&quot; and see if that gives your call-back a window.  Ideally you&#39;d only do such a thing when the system is  ready to accept callbacks.  I expect the foreign callback logic is wrong in only allowing callbacks when the VM is unlocked.  Instead, the system should probably see if the foreign callback priority is greater than the current process&#39;s priority, and then somehow preempt the current process (e.g. by setting stackLimit appropriately).  But I have no cycles to think about this right now.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 8, 2015 at 6:10 AM, Craig Latta <span dir="ltr">&lt;<a href="mailto:craig@netjam.org" target="_blank">craig@netjam.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Hi Eliot--<br>
<br>
     Well, I have a callback that gets as far as<br>
ownVMFromUnidentifiedThread() now, but I just keep spinning on<br>
tryLockVMOwner(). Help?<br>
<br>
<br>
     thanks again,<br>
<div class="HOEnZb"><div class="h5"><br>
-C<br>
<br>
--<br>
Craig Latta<br>
<a href="http://netjam.org" rel="noreferrer" target="_blank">netjam.org</a><br>
<a href="tel:%2B31%20%20%206%202757%207177" value="+31627577177">+31   6 2757 7177</a> (SMS ok)<br>
<a href="tel:%2B%201%20415%20%20287%203547" value="+14152873547">+ 1 415  287 3547</a> (no SMS)<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div>