Apparently this never made it out, or it went missing, or something, but it's important so it bears repeating.

Parrot is going to have a notification system built into it. This will ride on top of the vtable overloading and event system.

What is a notification system? Well, what it is is a simple system that posts an event when a watched resource is changed. We're going to watch modification, deletion, addition, and destruction.

How does it work? Simple. When a watched resource does what we're watching for (it changes, an entry is deleted, an entry is added, a thing is destroyed) we post an event to the event queue. When that event is processed, whatever notification routines were registered are run. Very simple.

Why?

Because there's all sorts of stuff we need to watch for performance reasons. The big thing the engine will use this for is class changes--for example when a class adds or deletes an attribute, all objects of that class or its subclasses needs to change. The easiest way to do this is have each subclass register a notification on its parent classes. We're also going to want to do this for symbol tables, since most of what people want to tie a symbol table for can be handled with notifications. (And they can tie it in those cases where a notification is insufficient)

What does this have to do with weak references?

Weak references are just references that aren't part of the root set and have a destruction notification pending on the thing they weakly refer to. When that thing is destroyed, the notification the weak ref PMC has registered will get run and invalidate the weak reference.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to