-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Service Arch
Launching threads in ServiceContext decoration constructors and constructor actions is currently prohibited, but it doesn't have to be. By doing the work to make the code in this range thread safe, and moving the construction of decorations to the end of the ServiceContext constructor, we could allow decorations to create threads and access the ServiceContext they decorate. This would simplify a lot of subsystem setup code that currently has to lazily initialize thread pools on first use or in a startup routing invoked directly from mongod or mongos's main functions.