Igor,

Igor Stasenko wrote:
> 
> So, unless you running RoarVM, i don't see that it is reasonable to
> support cross-thread callbacks.
> 

VisualWorks and Dolphin both support foreign callbacks, using two very
different implementations. Yes, it's not easy, as there are lots of ways to
create deadlocks and faults etc. Chris Uppal's implementation of JNIPort for
Dolphin came with a highly complicated 
http://metagnostic.dolphinmap.net/JNIPort/threading.html mechanism for
deadlock prevention  which is now also part of the ports of JNIPort to
VisualWorks, Pharo and Squeak.

However, there are situations where foreign callbacks are needed simply
because the external libraries which are used have a multithreaded
implementation. E.g., the callbacks for monitoring a Java VM (to monitor
class loading, garbage collection etc.) will always come from a foreign
thread, and this has nothing to do with performance. It's just the way it
is. Another example (see screenshot at the end of the page): 
http://metagnostic.dolphinmap.net/JNIPort/callback-example-1.html
http://metagnostic.dolphinmap.net/JNIPort/callback-example-1.html 

Best regards,
Joachim Geidel
-- 
View this message in context: 
http://forum.world.st/Alien-and-callbacks-from-foreign-threads-tp3175989p3176215.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

Reply via email to