[squeak-dev] Questions about external objects

David T. Lewis lewis at mail.msen.com
Sun Oct 26 01:06:33 UTC 2014

On Sun, Oct 26, 2014 at 02:06:20AM +0200, Levente Uzonyi wrote:
> I've uploaded the new versions of the packages to The Inbox, and moved the 
> old ones to The Treated Inbox.
> The main difference is that the Semaphore class is not modified, and its 
> instances are handled like any other object. There's also a new #cleanUp: 
> method which will allow freeing up some memory. And the caches are 
> shrinked whenever the external objects are wiped.
> Since Semaphores don't know their indexes anymore, the new part of the API 
> has also changed.
> The following snippet will load the new versions to an up-to-date Trunk 
> image:
> Installer squeakInbox
> 	package: 'System-ul.687';
> 	package: 'Sound-ul.40';
> 	package: 'Kernel-ul.883';
> 	package: 'Network-ul.154';
> 	package: 'Files-ul.140';
> 	install
> Levente

I like this a lot. Not only does it provide the ExternalSemaphoreTable
improvements, but I also find that when I restart my image with OSProcess
loaded, the indexesByObjects dictionary clearly shows the semaphore that
was registered for the child process watcher at image startup. Thus an
explorer on the ExternalSemaphoreTable will display semaphores associated
with processes that wait on them, which also identifies the process waiting
on that semaphore. You can see this right in the object explorer.

Very nice!

I note that a Semaphore can still know its external objects index by
querying the ExternalSemaphoreTable:

        ^ExternalSemaphoreTable externalIndexFor: self

   ExternalSemaphoreTable class>>externalIndexFor: anObject
        ^self current indexesByObjects at: anObject ifAbsent: [nil]



More information about the Squeak-dev mailing list