<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,&nbsp;<div class=""><br class=""></div><div class="">So… “multithread” is a complicated issue. Pharo as most Smalltalks is designed thinking is as monolithic so if you are trying to make the image to work in different processes… it will not be easy at all :)</div><div class="">Time ago Eliot did a prototype (more than a prototype in fact, but still far from “production ready”) to have Threaded FFI and I’m quite sure this is the way to go, at least as a 1st milestone.&nbsp;</div><div class=""><br class=""></div><div class="">I already have a process building this experimental VM:</div><div class=""><br class=""></div><div class=""><a href="https://ci.inria.fr/pharo/view/VM/job/CogMTVM/" class="">https://ci.inria.fr/pharo/view/VM/job/CogMTVM/</a></div><div class=""><br class=""></div><div class="">(No idea why windows build failed last two times… this can be a random fail).</div><div class=""><br class=""></div><div class="">I do not remember exactly the changes needed in the image to take advantage of it… it was just an instVar in Process, I think, but then FFI package was adapted to take advantage of this… no idea where it is now (if is already incorporated in latest FFI, which we have).</div><div class=""><br class=""></div><div class="">Then, after this… I imagine the callback mechanism can be adapted to work in multithread environments but probably we will need something like isolates from Dart to provide some degree of multithread processing without killing the image (but I’m just thinking in loud here, this can be a really bad idea, and probably there are other ways to do this better… I will let Eliot to explain better).&nbsp;</div><div class=""><br class=""></div><div class=""><b class="">TL;DR: </b>Start for the CogMTVM, is the way to go.</div><div class=""><br class=""></div><div class="">cheers,&nbsp;</div><div class="">Esteban</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 17 Apr 2015, at 09:06, Nicolai Hess &lt;<a href="mailto:nicolaihess@web.de" class="">nicolaihess@web.de</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class="">Hi, <br class=""><br class=""></div>I've tried to build a pharovm with multithread support. I changed the config in the <br class=""></div>pharo generator.image to use the cogmt config and was able to build a vm.<br class=""></div>But this vm crashes on startup. (windows7)<br class=""><br class="">Is this the right way and did anyone got this to work (windows or linux)?<br class=""><br class=""></div>And can this work to make NB callbacks working for multithreaded libraries.<br class=""></div><br class="">(I made some simple bindings for the gstreamer lib with NB, this works<br class=""></div>for simple calls (create element/change state). But I guess this won't work<br class=""></div>for any gstreamer function that requests a callback that may b e called from<br class=""></div>a different thread)<br class=""><br class=""></div>Would this be the right way to do:<br class=""></div>- build a vm with MT support<br class=""></div>- guard the NB callback entry/leave code with the ownVM()/disownVM() call.<br class=""><br class=""></div>Or is there more to do.<br class=""><br class=""></div><div class="">Thanks in advance<br class=""></div><br class=""><br class=""></div>nicolai<br class=""><div class=""><div class=""><div class=""><br class=""><br class=""></div></div></div></div>
</div></blockquote></div><br class=""></div></body></html>