Skip to content
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

Merged
merged 12 commits into from Oct 9, 2013

Commits on Oct 8, 2013

  1. The variable remainingEvents_ may be read by multiple threads simulta…

    …nously so must be atomic
    Dr15Jones committed Oct 8, 2013
    Configuration menu
    Copy the full SHA
    a10500b View commit details
    Browse the repository at this point in the history
  2. 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.
    Dr15Jones committed Oct 8, 2013
    Configuration menu
    Copy the full SHA
    89a6f14 View commit details
    Browse the repository at this point in the history
  3. 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.
    Dr15Jones committed Oct 8, 2013
    Configuration menu
    Copy the full SHA
    8c03a48 View commit details
    Browse the repository at this point in the history
  4. 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.
    Dr15Jones committed Oct 8, 2013
    Configuration menu
    Copy the full SHA
    9a8d8d9 View commit details
    Browse the repository at this point in the history
  5. 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.
    Dr15Jones committed Oct 8, 2013
    Configuration menu
    Copy the full SHA
    683b3e9 View commit details
    Browse the repository at this point in the history
  6. 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.
    Dr15Jones committed Oct 8, 2013
    Configuration menu
    Copy the full SHA
    4828ba4 View commit details
    Browse the repository at this point in the history
  7. 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.
    Dr15Jones committed Oct 8, 2013
    Configuration menu
    Copy the full SHA
    a3787d7 View commit details
    Browse the repository at this point in the history
  8. 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.
    Dr15Jones committed Oct 8, 2013
    Configuration menu
    Copy the full SHA
    711c510 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    08e5561 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    db85075 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2013

  1. 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.
    Dr15Jones committed Oct 9, 2013
    Configuration menu
    Copy the full SHA
    93422bd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5609dae View commit details
    Browse the repository at this point in the history