<br><br><div class="gmail_quote">On Fri, Feb 6, 2009 at 5:26 PM, Igor Stasenko <span dir="ltr"><<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>></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 <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>>:<br>
<div class="Ih2E3d">><br>
><br>
> On Fri, Feb 6, 2009 at 3:08 PM, Igor Stasenko <<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>> wrote:<br>
>><br>
>> 2009/2/6 Steve Wart <<a href="mailto:steve.wart@gmail.com">steve.wart@gmail.com</a>>:<br>
>> > We were thinking about using Hydra for a recent project for this reason.<br>
>> > Our<br>
>> > FFI calls were doing network I/O that made it impossible to maintain an<br>
>> > acceptable frame rate in Croquet.<br>
>> ><br>
>> > Unfortunately I didn't find the time to dig into this but our image size<br>
>> > was<br>
>> > already a problem and I assumed that this approach would make that<br>
>> > problem<br>
>> > worse. Maybe a Pharo image could exist on one thread to do network I/O<br>
>> > and a<br>
>> > regular Croquet thread could run on another thread?<br>
>> ><br>
>> > I recall that Hydra was released early because it was unexpectedly<br>
>> > successful, but I haven't heard much about it since then.<br>
>> ><br>
>><br>
>> Yes Hydra FFI is multithreaded already.<br>
><br>
> Does it support callbacks from threads? Does it support callbacks from<br>
> threads other than threads that have called-out? (I call these callbacks<br>
> foreign callbacks because they come from threads the Vm doesn't know exist<br>
> until they callback)<br>
<br>
</div>there is no extra functionality (callbacks) in addition to what<br>
original FFI plugin provides.<br>
I'm only made sure that plugin'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. 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. I think you should claim only that the Hydra FFI is thread-safe, not that it is multi-threaded. It isn't. 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> </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 'foreign' callbacks.. heh..<br>
I would rather name it an async event/hook. :)</blockquote><div><br></div><div>It is *not* an event hook. It is a means of invoking behaviour in the system being called. 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 'callback' 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]-> fnptr(x,y)<br>
[callback] ... in mySortFn<br>
[2]<- return from mySortFn<br>
<br>
[1]<- 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. I think event hooks are far more specific tan call-backs.</div><div><br></div><div>Anyway...</div><div> </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>
>><br>
>> But all thread safety problems which may arise when you using foreign<br>
>> modules are on your hands, of course.<br>
>><br>
>><br>
>> --<br>
>> Best regards,<br>
>> Igor Stasenko AKA sig.<br>
>><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>