New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serialize calls to EventSetup modules #1036
Serialize calls to EventSetup modules #1036
Commits on Oct 8, 2013
-
The variable remainingEvents_ may be read by multiple threads simulta…
…nously so must be atomic
Configuration menu - View commit details
-
Copy full SHA for a10500b - Browse repository at this point
Copy the full SHA a10500bView commit details -
First version to actually process multiple events concurrently
This version uses a TBB task per Stream to process Events with a mutex used to protect the Source in a critical section. This is sufficient to test the thread safety of the framework internals.
Configuration menu - View commit details
-
Copy full SHA for 89a6f14 - Browse repository at this point
Copy the full SHA 89a6f14View commit details -
Propagate exceptions thrown during processing to the main thread
The EventProcessor now uses the new C++11 std::exception_ptr, std::current_exception() and std:rethrow_exception() to capture a thrown exception in a thread processing an event and then transfer that exception to the main thread to be rethrown. We use an std::atomic to provide thread safe update of the std::exception_ptr member data in the case of multiple processing threads having an exception. In such a case, only one of the exceptions will be kept.
Configuration menu - View commit details
-
Copy full SHA for 8c03a48 - Browse repository at this point
Copy the full SHA 8c03a48View commit details -
Added classes to managed resources shared by multiple modules
The SharedResourcesRegistry is the centralized place where resources are registered and where the framework can get SharedResourcesAcquirer instances. These two classes work together to allow safe sharing of non-thread safe resources between modules. A unit test is included to test the two classes.
Configuration menu - View commit details
-
Copy full SHA for 9a8d8d9 - Browse repository at this point
Copy the full SHA 9a8d8d9View commit details -
Switched to using recursive_mutex and moved SharedResourcesAcquirer.h…
… to interface In order to more easily accommodate unscheduled execution, I switched from using a mutex to a recursive_mutex. This will be less performant since the locks will be held longer than might be needed but it is easier to implement initially. A more performant way would be to release the locks temporarily while we are doing a ‘edm::Event::getBy*’ call.
Configuration menu - View commit details
-
Copy full SHA for 683b3e9 - Browse repository at this point
Copy the full SHA 683b3e9View commit details -
Made legacy modules thread safe
Now uses a std::mutex to guarantee a module instance is only processing one event at a time. Also uses a edm::SharedResourcesAcquirer to get the legacy resource and therefore guarantee only one legacy module is running at a time.
Configuration menu - View commit details
-
Copy full SHA for 4828ba4 - Browse repository at this point
Copy the full SHA 4828ba4View commit details -
Use the SharedResourcesAcquirer when a ‘one’ type module declares a S…
…haredResource All ‘one’ style base classes now hold a SharedResourcesAcquirer and use a new virtual function ‘createAcquirer()’ which by default returns an empty SharedResourcesAcquirer instance. If the module declares the use of a ‘SharedResource’ then the ‘createAcquirer()’ method will be overridden and return an instance with the needed resources. To facility this, edm::one::imll::SharedResourcesUser had to be changed to a templated class.
Configuration menu - View commit details
-
Copy full SHA for a3787d7 - Browse repository at this point
Copy the full SHA a3787d7View commit details -
Need to explicitly instantiate the SharedResourcesUser templated class
The SharedResourcesUser class was just changed to a template. As with the other implementor types, this needs to be explicitly instantiated.
Configuration menu - View commit details
-
Copy full SHA for 711c510 - Browse repository at this point
Copy the full SHA 711c510View commit details -
Configuration menu - View commit details
-
Copy full SHA for 08e5561 - Browse repository at this point
Copy the full SHA 08e5561View commit details -
Configuration menu - View commit details
-
Copy full SHA for db85075 - Browse repository at this point
Copy the full SHA db85075View commit details
Commits on Oct 9, 2013
-
Make access to EventSetup thread safe
Use a global mutex to serialize access to all EventSetup modules and sources. This is overkill but guarantees that if any two modules/sources are sharing a non-thread safe resource we don’t have a problem. Changed two of the mutable to std::atomics since they are read/written outside of the critical section guarded by the mutex.
Configuration menu - View commit details
-
Copy full SHA for 93422bd - Browse repository at this point
Copy the full SHA 93422bdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5609dae - Browse repository at this point
Copy the full SHA 5609daeView commit details