On Thu, Aug 28, 2003 at 07:26:25PM -0400, Dan Sugalski wrote:
> 
> 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 [...]

Only after the action being watched is performed I presume.

Any implementation details? (maybe I missed them) Will it be
implemented via vtable changes, proxy objects, or ...?

> we post an event to the event queue. When that 
> event is processed, whatever notification routines were registered 
> are run. Very simple.

The async nature of this approach needs to be kept in mind. It will
often be important that the 'thread' handling the event queue runs
at a high priority. (Perhaps it would help to have a simple flag
on each watch to say if a yield() should be performed after posting
an event for that watch.)

> 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.

What happens, or could happen, between the event being queued and
it being actioned?

> 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.

And what happens if the weak ref is used between the thing it refers to
being destroyed and the notification event being acted on?

Tim.

Reply via email to