<br><br><div class="gmail_quote">On Fri, Feb 6, 2009 at 5:26 PM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@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;">
2009/2/7 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:<br>
<div class="Ih2E3d">&gt;<br>
&gt;<br>
&gt; On Fri, Feb 6, 2009 at 3:08 PM, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; 2009/2/6 Steve Wart &lt;<a href="mailto:steve.wart@gmail.com">steve.wart@gmail.com</a>&gt;:<br>
&gt;&gt; &gt; We were thinking about using Hydra for a recent project for this reason.<br>
&gt;&gt; &gt; Our<br>
&gt;&gt; &gt; FFI calls were doing network I/O that made it impossible to maintain an<br>
&gt;&gt; &gt; acceptable frame rate in Croquet.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Unfortunately I didn&#39;t find the time to dig into this but our image size<br>
&gt;&gt; &gt; was<br>
&gt;&gt; &gt; already a problem and I assumed that this approach would make that<br>
&gt;&gt; &gt; problem<br>
&gt;&gt; &gt; worse. Maybe a Pharo image could exist on one thread to do network I/O<br>
&gt;&gt; &gt; and a<br>
&gt;&gt; &gt; regular Croquet thread could run on another thread?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I recall that Hydra was released early because it was unexpectedly<br>
&gt;&gt; &gt; successful, but I haven&#39;t heard much about it since then.<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; Yes Hydra FFI is multithreaded already.<br>
&gt;<br>
&gt; Does it support callbacks from threads? &nbsp;Does it support callbacks from<br>
&gt; threads other than threads that have called-out? &nbsp; (I call these callbacks<br>
&gt; foreign callbacks because they come from threads the Vm doesn&#39;t know exist<br>
&gt; until they callback)<br>
<br>
</div>there is no extra functionality (callbacks) in addition to what<br>
original FFI plugin provides.<br>
I&#39;m only made sure that plugin&#39;s own state which used during<br>
conversion of values is thread safe.</blockquote><div><br></div><div>OK, so the FFI does *not* support threads. &nbsp;It is merely thread-safe so that multiple hydra instances can be making FFI call-outs at the same time.</div>
<div><br></div><div>That is an entirely different thing to an FFI that is multithreaded. &nbsp;I think you should claim only that the Hydra FFI is thread-safe, not that it is multi-threaded. &nbsp;It isn&#39;t. &nbsp;The common understanding of a multi-threaded FFI is one that allows one to call-out and call-ack on multiple threads.</div>
<div><br></div><div><br></div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
<br>
A callback support , added by Andreas, is not related to FFI. It can<br>
be used by plugins , and the only plugin i saw which using it was a<br>
python bridge.<br>
<br>
As for &#39;foreign&#39; callbacks.. heh..<br>
I would rather name it an async event/hook. :)</blockquote><div><br></div><div>It is *not* an event hook. &nbsp;It is a means of invoking behaviour in the system being called. &nbsp;Call-back is the common term for this.</div><div>
<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">To my understanding a &#39;callback&#39; term, its pattern which invented by<br>
C-ers for passing a closure deeper into a stack i.e. callback function<br>
should be called from within a function which takes it as argument and<br>
never after it returns :<br>
<br>
[1] sort(array, mySortFn);<br>
<br>
[2]-&gt; fnptr(x,y)<br>
[callback] ... in mySortFn<br>
[2]&lt;- &nbsp;return from mySortFn<br>
<br>
[1]&lt;- return from sort()<br>
<br>
where [1] is caller context, and [2] is function which using callback argument.<br>
<br>
If it not behaves like this, then its not a callback anymore - call it<br>
a hook, event or something else :)</blockquote><div><br></div><div>I disagree. &nbsp;I think event hooks are far more specific tan call-backs.</div><div><br></div><div>Anyway...</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<div class="Ih2E3d"><br>
<br>
&gt;&gt;<br>
&gt;&gt; But all thread safety problems which may arise when you using foreign<br>
&gt;&gt; modules are on your hands, of course.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Best regards,<br>
&gt;&gt; Igor Stasenko AKA sig.<br>
&gt;&gt;<br>
<br>
<br>
</div>--<br>
<div><div></div><div class="Wj3C7c">Best regards,<br>
Igor Stasenko AKA sig.<br>
<br>
</div></div></blockquote></div><br><div>Best</div><div>Eliot</div>