excelent! I saw your mail in the list but didn&#39;t know that you came to a solution for the problem. I think that using a single-threaded VM will be better in the short term, as it&#39;s much easier to debug and so to get everything working. I&#39;ll check your code.<div>

<br></div><div>Thanks!</div><div>Javier.<br><br><div class="gmail_quote">On Fri, Sep 9, 2011 at 11:41 AM, Dimitry Golubovsky <span dir="ltr">&lt;<a href="mailto:golubovsky@gmail.com">golubovsky@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Javier,<br>
<br>
It looks you are following the same trail I have been walking on for<br>
some time (I mean Android Cog).<br>
<br>
Feel free to borrow my experience from this repo:<br>
<br>
<a href="http://gitorious.org/~golubovsky/cogvm/dmg-blessed" target="_blank">http://gitorious.org/~golubovsky/cogvm/dmg-blessed</a><br>
<br>
and also VMMaker-oscog and CMakeVMMaker packages in <a href="http://squeaksource.com/EventVM" target="_blank">squeaksource.com/EventVM</a><br>
<br>
In general, I turned Stack Cog into an event-driven VM (like Andreas<br>
did some time ago in his Android port of Classic VM).<br>
<br>
I believe that for any kind of embedding this approach of making an<br>
event-driven VM is preferrable.<br>
<br>
I remember asking a similar question some time ago, here:<br>
<br>
<a href="http://lists.squeakfoundation.org/pipermail/vm-dev/2011-July/008647.html" target="_blank">http://lists.squeakfoundation.org/pipermail/vm-dev/2011-July/008647.html</a><br>
<br>
As a by-product of my Android port, I created a Unix EventVM (see<br>
StackEvtUnixConfig class in CMakeVMMaker) though it is not polished.<br>
It uses two extra files in the Unix platform: sqUnixEvtBeat.c and<br>
sqUnixEvtMain.c. The former is transformed sqheartbeat.c, the latter<br>
is replacement of sqUnixMain.c with dummy external event loop (as it<br>
no longer belongs to the interpreter).<br>
<br>
You also may look at the android version of the same file<br>
(sqAndroidEvtBeat.c in the android platform) where all time-fetching<br>
functions request actual time from the underlying OS (calling<br>
gettimeofday() and similar functions instead of getting time from a<br>
memory location updated by another thread).<br>
<br>
Besides, my VM is single-threaded. I do use SIGALRM though, to limit<br>
maximal time in interpreter so Android does not kill the application,<br>
however NaCL&#39;s policy may be different.<br>
<br>
Anyway, this may be a long discussion, Feel free to ask.<br>
<br>
Thanks.<br>
<font color="#888888"><br>
--<br>
Dimitry Golubovsky<br>
<br>
Anywhere on the Web<br>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br>Lic. Javier Pimás<br>Ciudad de Buenos Aires<br>
</div>