[squeak-dev] Dumb question about Hydra VM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Dumb question about Hydra VM

Schwab,Wilhelm K
Hello all,

In doing some catch-up reading, I found Igor's notes:

   http://squeakvm.org/%7Esig/hydravm/devnotes.html

and am wondering whether (in particular) the FFIPlugin's support for the
new VM means that one can call external functions on a new thread?  Just
clarifying before I get too enthusiastic.  In particular, I am hoping
for an equivalent to Dolphin's overlapped call mechanism, which tells
the Dolphin VM to make an affected call using one[*] of a pool of native
threads, blocking only the calling Process rather than the entire image
for the duration of the call.  Will Hydra offer similar capability?

Bill

[*] originally, the threads were chosen by availability, in D6, my
understanding is that (more or less) the VM guarantees to make all
overlapped calls for a given Process on the same native thread.




Wilhelm K. Schwab, Ph.D.
University of Florida
Department of Anesthesiology
PO Box 100254
Gainesville, FL 32610-0254

Email: [hidden email]
Tel: (352) 846-1285
FAX: (352) 392-7029


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Dumb question about Hydra VM

Igor Stasenko
2008/5/3 Bill Schwab <[hidden email]>:

> Hello all,
>
>  In doing some catch-up reading, I found Igor's notes:
>
>    http://squeakvm.org/%7Esig/hydravm/devnotes.html
>
>  and am wondering whether (in particular) the FFIPlugin's support for the
>  new VM means that one can call external functions on a new thread?  Just
>  clarifying before I get too enthusiastic.  In particular, I am hoping
>  for an equivalent to Dolphin's overlapped call mechanism, which tells
>  the Dolphin VM to make an affected call using one[*] of a pool of native
>  threads, blocking only the calling Process rather than the entire image
>  for the duration of the call.  Will Hydra offer similar capability?
>
>  Bill
>
>  [*] originally, the threads were chosen by availability, in D6, my
>  understanding is that (more or less) the VM guarantees to make all
>  overlapped calls for a given Process on the same native thread.
>
>

There is no such thing as 'overlapped calls'. Each interpreter
instance making calls from own thread, means that you need to make
sure that your FFI functions/libraries works fine with multiple
threads.
The FFI plugin was ported before i introduced 'attached states'
concept, so it using naive locking by mutex to prevent damaging FFI
plugin internal state (this means that you can't execute two or more
FFI calls simultaneously), but still, each call is made from own
interpreter thread..

To make something similar what Dolphin does, it would require writing
own, more or less simple plugin, which can do following:
- on initialization, create native thread
- define a primitive, which will call another primitive (or C function
pointer) using given thread.
This is what 'overlapping' call does, i am right?


>
>
>  Wilhelm K. Schwab, Ph.D.
>  University of Florida
>  Department of Anesthesiology
>  PO Box 100254
>  Gainesville, FL 32610-0254
>
>  Email: [hidden email]
>  Tel: (352) 846-1285
>  FAX: (352) 392-7029
>
>
>



--
Best regards,
Igor Stasenko AKA sig.