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

Enhance locking mechanism #162

Open
bitboom opened this issue Aug 29, 2023 · 2 comments
Open

Enhance locking mechanism #162

bitboom opened this issue Aug 29, 2023 · 2 comments

Comments

@bitboom
Copy link
Collaborator

bitboom commented Aug 29, 2023

When double-locking occurs, it is hard to detect. (just hang)
One example of double-locking is that lock two granules with same address.
This occurred in realm-creation test of ACS. #155

Suggestion 1

  • Add try_lock
@jinbpark
Copy link
Collaborator

I think too we need this.

The best way IMO, only considering "security" not "usability" is to enforce accessing to granule inside closure, and then, make sure that no APIs to lock again are exposed within the closure. But, this is not a usable solution, as we may unnecessarily fall into nested closures.

So, I think too try_lock is a way to go.
Plus, when we deal with this, we may also need to take into account "dead-lock" prevention.

@bokdeuk-jeong
Copy link
Collaborator

what do you mean by locking two (distinct) granules with the same address?

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

3 participants