[ORC] Automatically suspend and resume lookups that depend on in-use generators.
Access to individual DefinitionGenerators is serialized in order to make generators easier to implement: serializing access means that tryToGenerate methods don't have to handle concurrent, potentially overlapping, requests. Prior to this patch serialization was achieved by having each lookup acquire a lock on each generator, however this causes the lookup thread to block if the generator is in use. In the common case where many objects reference some common library symbol that is provided by a generator this may cause many threads to block concurrently preventing progress on other work. This patch changes the model so that lookups are automatically suspended if they need to use a generator that is already in use, and then automatically resumed once the generator is free. This is achieved by reusing the lookup suspension machinery that was introduced in 069919c9 for optionally asynchronous generators.
parent
3a100ea9
Please register or sign in to comment