Callbacks, simplified.

tim Rowledge tim at
Wed Jun 7 18:33:22 UTC 2006

On 6-Jun-06, at 5:00 PM, Andreas Raab wrote:

> tim Rowledge wrote:
>> How are you proposing to deal with the callback at the higher  
>> levels? Is the plugin going to be allowed to cons up a message and  
>> 'send' it? Or.....?
> This should be up to the plugin. I can't think of a good interface  
> right now given that we don't have enough examples to look at and  
> learn from. Personally, I'm just signaling a semaphore before the  
> callback and have the image "pull up" the arguments via primitives.  
> This avoids the need to do too much at the primitive level.

So would simply using the normal semaphore signalling be ok? We  
already have external semaphore capability so it would certainly be  
simple to provide! If we implemented callbacks by taking a block (or  
a MessageSend?), making a Process that will use it, make the process  
wait on a Semaphore and pass the semaphore index  down to the plugin,  
then signalling the semaphore would run the block/whatever and  
presumably ask the plugin for relevant arguments. As long as it can  
be non-synchronous that should work for a lot of cases, surely?

tim Rowledge; tim at;
Klingon Code Warrior:- 9) "A TRUE Klingon warrior does not comment  
his code!"

More information about the Vm-dev mailing list