[squeak-dev] Questions about external objects

Levente Uzonyi leves at elte.hu
Sun Oct 12 06:04:33 UTC 2014


Hi,

I found that the handling of external objects is suboptimal in the image, 
and I came up with some ideas to make it better. I have a working solution 
in my image, but it can be even better.

It seems to me that only Semaphores are stored in the external objects 
array (slot 39 in the special objects array), but in practice any object 
can be stored there. Does it make sense to support objects of any other 
kind? If not, then the code could be simplified.

I also thought that I'll create a special semaphore (ExternalSemaphore -
which is a subclass of Semaphore) that knows its own index in the 
external objects array. This could be really handy for finding the 
object in the array, but the VM is not willing to signal these semaphores 
in the external objects array. I thought that this is because the VM 
doesn't know anything about this class.
So I tried to change Semaphore itself, but after the change the VM refused 
to signal any semaphores in the external objects array. Changing the class 
back to the original didn't help either. Without looking at the VM 
code, I assumed that the VM will signal anything which has the 
class in the 19th slot of the special objects array, but that doesn't seem 
to be the case.
Is there any way to make this (add an instatnce variable to Semaphore and 
still get signals from the VM, or use instances of a subclass of Semaphore 
there) work?

Levente


More information about the Squeak-dev mailing list