swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help on walking lists of Swarm Collection


From: William S. Shu
Subject: Re: Help on walking lists of Swarm Collection
Date: Tue, 11 May 1999 20:49:46 +0100


>>>>>> "WS" == William S Shu <address@hidden> writes:
>
>WS> The malariaPopModelSwarm grabs the colonyList and removes the dead
>WS> agent, possibly before the person agent has finished with it!  In
>WS> computing terms, colonyList becomes a critical resource which must
>WS> be accessed only by exactly the one agent modifying it.
>
>It's important to ensure that accesses to colonyList (index creation
>and disposal) happen at a different time from changes to colonyList.
>If that's not feasible, write a single access method for accessing
>colonyList, one that will ensure that broken indices won't ever be
>used.  One way to do this is to have a flag that is set by a notify
>function that will cause the access method to break out of any index
>iteration that is currently underway, recreating the indices.


I thought the notify function (via addRef:withArgument) is used only when
dropping objects -- that is, when the drop method is invoked directly or
otherwise!  I may want to remove items from a list without necessarily
dropping them, or the list.  Could you please give an example (probably
heavily commented) of how the notifyFucntion could be used?
>
>WS> The notify function is declared as follows.
>
... deleted lines ...

>WS> objX revokes notification by issuing:
>WS>    [objX removeRef: objXVariable];
>
>You'd send it to objY.


Do you mean I send a message as:
    [objY removeRef: objXVariable];
instead?  (Sorry.  I wish to be abundantly clear!)

Thanks

William.



                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]