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

Mitigation for nested lock (or deadlock) #7

Open
shsym opened this issue Jul 20, 2024 · 0 comments
Open

Mitigation for nested lock (or deadlock) #7

shsym opened this issue Jul 20, 2024 · 0 comments

Comments

@shsym
Copy link
Member

shsym commented Jul 20, 2024

For a complicated data structure where Roy data structures are defined within another Roy.remote data structure, developers accidentally try to lock the inner lock inside the critical section (=while the outer class is already holding the hierarchical locks).

  • For this case, we can skip the locking/unlocking in __enter__ and __exit__, because a single instance of Roy data structure or class should be accessible by a single thread. In other words, each Ray worker has its own instance of the data structure.

Example:

- Class A
  - Class B
  • When the outer class is locked, say with Class A:, the inner class (Class B) is also locked automatically.
  • When a developer accidentally does with Class B: within with Class A:, if we can confidently detect this occurrence, we can skip locking/unlocking around with Class B: and going out of the context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant