sirikata / sirikata

Sirikata is a BSD-licensed platform for networked 3d environments
http://www.sirikata.com/
Other
126 stars 39 forks source link

Thread safety of AggregateManager::mObjectsByPriority #516

Closed ewencp closed 11 years ago

ewencp commented 11 years ago

The two methods that access and modify this data are commonly running in different threads. queueDirtyAggregates always runs in aggregation thread 0 and adds items to the queues. generateMeshesFromQueues runs across all aggregation threads and pulls items out of the maps and aggregates them. The maps need to be lock protected, but this isn't a trivial addition with the current code structure in generateMeshesFromQueue since it would have to take the lock for the entire duration of its call.