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

Fix potential deadlocks when building proxies/registering stubs in callbacks from events #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on May 3, 2017

  1. Fix potential deadlocks when building proxies/registering stubs in ca…

    …llbacks from events
    
    The Observer design pattern has now been applied in a way that avoids deadlocks,
    has better support for concurrency and provides more natural semantics for the
    client code:
    - An internal mutex is no longer locked while calling back the notify functors (the
    listeners) registered by the user.
    - The non-interference/concurrency relationship between the notification functions
    and the subscribe/unsubscribe functions has remained valid.
    - A new notification iteration can now begin in parallel (e.g.: on another thread)
    with an on-going notification. The notification iterations do not interfere with
    each other.
    - The functor callbacks registered by the user with calls to the subscribe function
    are now deleted by the call to the unsubscribe function (i.e. deterministically from
    the user's point of view), as opposed to being deleted at some point in the future
    when/if a notification  happens to be broadcast again (i.e. nondeterministically
    from the user's point of view).
    - Internally, the implementation of the Event class template has been simplified
    (e.g.: by only using one mutex and by letting go of the subscribe/unsubscribe
    lists) and the code is now easier to understand.
    CatalinMihaiGhita authored and Catalin Mihai Ghita committed May 3, 2017
    Configuration menu
    Copy the full SHA
    5aa25c5 View commit details
    Browse the repository at this point in the history