I am committing a set of patches this week which make data access and locking 
of presences within the scene graph more consistent. There are currently many 
ways to get presence data from the scene graph and/or iterate over it. To name 
a few, there are GetScenePresence, TryGetAvatar, GetScenePresences and 
ForEachScenePresence.  Unfortunately, some of these have relied on the callers 
locking the list or checking for null references which was missing in many 
places.



The patches move all locking into SceneGraph, eliminate GetScenePresence in 
favor of TryGetAvatar, and consolidates the two different presence iteration 
patterns. Instead of calling GetScenePresences() and iterating over the result, 
modules and other code should call ForEachScenePresence(Action<ScenePresence>) 
and let SceneGraph do the parallel work. Eventually this will also mean that 
the list does not need to be copied or locked in order to iterate since it 
changes infrequently but is iterated my many callers simultaneously.



The goal is to move SceneGraph toward a self-supporting container of entities 
with properties and a small lightweight interface for adding, removing, and 
performing actions on the container through the use of properties/components, 
filters, and delegates. Supporting or allowing a module to grab a reference to 
the internal array of presences and lock it so that no other thread may 
add/remove/iterate is seriously limiting scalability and has introduced 
reliability issues and races between the scene and some modules.



Dan lake

Intel Labs

[email protected]<mailto:[email protected]>

_______________________________________________
Opensim-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/opensim-dev

Reply via email to