Against wastefull forks (Re: Taking Ownership of Squeak (WAS Re: Python at Disney))

Ned Konz ned at bike-nomad.com
Sat Mar 10 04:14:46 UTC 2001


On Friday 09 March 2001 19:53, C. Keith Ray wrote:

> Can anyone tell me if it how difficult it would be to have external C code
> send a message with arguments to a Squeak object and get the result
> (assuming Squeak was made into a shared library), without using something
> indirect like a TCP/IP connection?

Look at Smalltalk/X, which provides the functionality you're suggesting.
It also allows methods to be written in various languages.

The main problem with callbacks is that you'd need to somehow associate the 
callback with whichever Squeak object wanted to get it. If a single callable 
entry point into Squeak were used for all callbacks (or all callbacks of a 
given type), how would it know which semaphore to signal that the callback 
had occurred without knowing the particulars of a given callback (for 
instance, if the third parameter is 0x12345 then signal semaphore 32)?

Alternatively, one could build callback routines on the fly (processor and OS 
specific), lock them down and mark them as executable memory (OS specific), 
and then use them for callbacks. There would have to be buffers provided as 
well for whatever data was being passed, and these would have to be locked as 
well.

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com





More information about the Squeak-dev mailing list