[squeak-dev] Dumb question about Hydra VM

Igor Stasenko siguctua at gmail.com
Sat May 3 13:41:24 UTC 2008


2008/5/3 Bill Schwab <BSchwab at anest.ufl.edu>:
> 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: bschwab at anest.ufl.edu
>  Tel: (352) 846-1285
>  FAX: (352) 392-7029
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list