<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hi Dimitris,<br></div><div><br>On Jan 18, 2016, at 4:11 AM, Dimitris Chloupis &lt;<a href="mailto:kilon.alios@gmail.com">kilon.alios@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><span></span></div></blockquote><blockquote type="cite"><div><div dir="ltr">AFAIK OS thread are capable of being assigned to multiple cores thus offering real concurency, thus I presume your native threads are not OS threads. So the VM run on one thread but can communicate with other threads ? Does that apply to multithreaded VM ?<br></div></div></blockquote><div><br></div>As I said these /are/ native OS threads. &nbsp;The VM arranges that only one native thread can run the VM at any one time. &nbsp;The owning thread locks out other threads. &nbsp;The VM makes an FFI call out on one OS thread which unlocks the VM just before calling out and if that callout takes enough time for the heartbeat thread to beat then another thread will be released to try and lock and run the VM. &nbsp;If it wins the race the other call out thread will block when trying to rhea quire the VM to return it's result.<div><br></div><div>So this is real multi threading without concurrency as I said.<br><div><br><blockquote type="cite"><div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jan 18, 2016 at 2:02 PM Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">&nbsp;<div dir="auto"><div>Hi Dimitris,<br></div></div><div dir="auto"><div><br>On Jan 18, 2016, at 3:29 AM, Dimitris Chloupis &lt;<a href="mailto:kilon.alios@gmail.com" target="_blank">kilon.alios@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><span></span></div></blockquote><blockquote type="cite"><div><div dir="ltr"><div>so I assume that means callbacks from inside C threads works fine which make it more than enough at least for now. <br></div></div></div></blockquote><div><br></div></div><div dir="auto">C threads us a misnomer.&nbsp; Callbacks from native threads that are currently calling out work.&nbsp; I /think/ callbacks from native threads that have previously called out but are not currently calling out work, but am not sure.&nbsp; Callbacks from native threads the VM has not seen before don't yet work; the VM doesn't service them.<div></div></div><div dir="auto"><div><br><blockquote type="cite"><div><div dir="ltr"><div>Does that mean that the VM will implement a real threading mechanism ?&nbsp;</div></div></div></blockquote><div><br></div></div></div><div dir="auto"><div>This is a mechanism that allows one to freely share the VM between arbitrary native threads but only one thread can run the VM at any one time.&nbsp; So it provides true multi threading but it does /not/ provide concurrency.</div></div><div dir="auto"><div><br></div><div><blockquote type="cite"><div><div class="gmail_quote"><div dir="ltr">On Mon, Jan 18, 2016 at 1:11 PM Craig Latta &lt;<a href="mailto:craig@netjam.org" target="_blank">craig@netjam.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
&gt; ...when Craig Latta tried to use [Alien FFI] late last year it worked<br>
&gt; up to a point.&nbsp; The thing that didn't work was callbacks from foreign<br>
&gt; threads.&nbsp; So it looks like the core threading code is not too far<br>
&gt; away from working.<br>
<br>
&nbsp; &nbsp; &nbsp;(Yes, it seemed close enough that I spent several hours debugging,<br>
trying to get it the rest of the way. I ran out of time, so I wrote a<br>
wrapper C library around the one I wanted to use, with threaded C<br>
callback functions that signalled Smalltalk semaphores on which my<br>
synchronous-FFI Smalltalk process waited. A hack, but it worked fine and<br>
was simple.)<br>
<br>
<br>
-C<br>
<br>
--<br>
Craig Latta<br>
<a href="http://netjam.org" rel="noreferrer" target="_blank">netjam.org</a><br>
+31&nbsp; &nbsp;6 2757 7177 (SMS ok)<br>
+ 1 415&nbsp; 287 3547 (no SMS)<br>
<br>
</blockquote></div>
</div></blockquote></div></div></blockquote></div>
</div></blockquote></div></div></body></html>