Community
Participate
Working Groups
Build ID: I20070625-1500 Steps To Reproduce: N/A More information: To my understanding the PDB is intended for the construction of maximally shared tree structures. However currently the maximal sharing guarantee does not hold in a multi-threaded environment in absence of external sychronization. In my opinion it's better to make the library thread-safe instead of letting the 'user' take care of it. I had a look at the code and these are the 'unsafe' locations I identified: -org.eclipse.imp.pdb.facts.type.TypeFactory: Unsynchronized access to shared data (the cache and the prototypes). -org.eclipse.imp.pdb.analysis.AnalysisFactoryElement#getDescriptors(): Unsynchronized access/initialization of 'shared' data (fDescriptors). -org.eclipse.imp.pdb.facts.db.FactBase: Unsynchronized access to shared data. -org.eclipse.imp.pdb.PDBPlugin#getPreferencesService(): Unsynchronized access to shared data (preferencesService). -The initialization of org.eclipse.imp.pdb.PDBPlugin is not entirely thread-safe (Eclipse's example plugin-template is flawed). -The construction of collections using a 'writer' is unsafe for a number of reasons.
Note: It is the intention that the PDB's type system is 'maximally shared', a.k.a. has canonical in-memory representations of types. This says nothing about the implementations of IValueFactory, which is abstract such that implementors of these factories can choose for canonical or non-canonical implementations. This bug could be split into several bugs, each for every unsynchronized access to shared data instance.