Search code examples
smalltalkffipharo

Pharo 4 FFI async callbacks


What are the options (if any) to handle asynchronous FFI callbacks in Pharo 4? By asynchronous I mean that callback gets invoked by foreign language library some time after the FFI function that sets the callback has finished and returned to Smalltalk.

Example of NativeBoost callbacks in the image is synchronous (callback happens while the FFI function is executing), will it also work for async callbacks?

Or maybe one of the older FFI mechanisms will be able to handle this situation?

Than there is CogMT which if I understand could handle this case but also much more. Would it be possible to run Pharo 4 with this virtual machine?


Solution

  • There is no way to do that in Pharo right now :(

    The CogMT is experimental and cannot be used for real at the moment, we are working on a ThreadedFFI, which is what you ask for, but it will not be ready until the end of the year (hopefully).