<div dir="ltr">Marc,<div><br></div><div>Thank you for the example! This will definitely allow me to run multiple threads to separate UI from audio processing. </div><div><br></div><div>I will try to dig a bit deeper to understand how the VMs work. One of the things I need to do is invoking a function on a specific VM (to generate audio I need to register a C callback that is invoked on a thread that is not controlled my me). My plan is having a standard VM running the main program and have another "idle" VM that will only be invoked by the C callback function. This way I should avoid corruption of the main VM stack. This idle VM would receive the information it needs from an in process message queue or a socket. If I can find the way of invoking the function on the right VM, I think my problem would be solved.</div>

<div><br></div><div>Thank you!</div><div><br></div><div>Regards,</div><div>Francisco</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 5, 2014 at 12:17 PM, Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca" target="_blank">feeley@iro.umontreal.ca</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br>
On Apr 1, 2014, at 10:06 AM, Francisco <<a href="mailto:fjvallarino@gmail.com">fjvallarino@gmail.com</a>> wrote:<br>
<br>
> I have not found the post you mention. Based on <a href="https://mercure.iro.umontreal.ca/pipermail/gambit-list/2014-February/007441.html" target="_blank">https://mercure.iro.umontreal.ca/pipermail/gambit-list/2014-February/007441.html</a>, I understood it was a work in progress... If you remember the thread, it would be great.<br>


<br>
</div>Here is an example that uses the multiple VM support.  I’ve tested it on OS X only, but it should be portable to other OSes.<br>
<br>
You first have to build Gambit with<br>
<br>
    ./configure --enable-multiple-vms<br>
    make<br>
<br>
And then<br>
<br>
    cd multiple-vm-example<br>
    make<br>
<br>
then<br>
<br>
    telnet localhost 12345<br>
<br>
to connect to the VM that is created.<br>
<br>
There are still issues with the multiple VM support, notably the VMs share a single console, which means there are race conditions if you try to read/write things to the console from different VMs. This is why the example code runs one of the VMs on a network connection (which is probably what you want to do anyway in practice).<br>


<span class="HOEnZb"><font color="#888888"><br>
Marc<br>
<br>
</font></span></blockquote></div><br></div>