Warning, /kdevelop/kdevelop/kdevplatform/language/duchain/locking.txt is written in an unsupported language. File is not indexed.

0001 Definition-use chain locking design
0002 ===================================
0003 
0004 Objective: To enable concurrent definition-use chain building, while maintaining thread safety, accuracy, and performance.
0005 
0006 Example tasks
0007 1) Building of a chain from scratch
0008 2) Re-building a chain from modified source code
0009 3) Interrogating a chain for code completion, refactoring etc.
0010 
0011 Write Access
0012 - change relationships between items
0013 - create new items
0014 - delete items no longer needed
0015 
0016 Old scheme:
0017 One RW lock for each top-level context.  Pros: allowed concurrent writing in different chains.  Cons: prone to deadlocks.
0018 
0019 New scheme:
0020 One RW lock for the entire chain.  Idea is for write locks to be held for brief periods of time.  Thus, need read locks to be held for brief periods too.
0021 
0022 When a read lock is held, no changes may be made to the chain.  Evaluations done prior to the lock being taken are invalid and have to be repeated, so prefer to do your evaluations with the lock held.
0023 
0024 When a write lock is held, changes may be made to the chain.  Objects may be deleted, as code will not be running inside them.  Need to provide speedy lookup as to whether an object has been deleted or not.
0025 
0026 Objects owned by a document may only be deleted by a builder operating on that document.  Additionally, need to guarantee that no more than one builder will be active on each document at any time.  This way, the builder doesn't have to ensure that its objects are not being deleted from underneath it.