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

3 step protocol for cap active needs to be fixed #363

Open
WenyuanShao opened this issue Jun 20, 2018 · 1 comment
Open

3 step protocol for cap active needs to be fixed #363

WenyuanShao opened this issue Jun 20, 2018 · 1 comment

Comments

@WenyuanShao
Copy link
Contributor

WenyuanShao commented Jun 20, 2018

3 step protocol for cap active needs to be fixed. There is a bug in this function.

@gparmer
Copy link
Collaborator

gparmer commented Jun 27, 2018

To add more detail:

The three-step protocol for capability activation is meant to address races between two capability activations in the same slot. Currently, the code in the repo simply doesn't do this. The abstractions of the code abide by the 3 step protocol, but the implementation of that abstraction does not. BUG.

The three steps are:

  1. Atomically mark the slot as allocated (with cas).
  2. Update the body of the slot but not the type, so that any parallel accesses to the slot will fail as it is being populated.
  3. Only after the slot is well-formed, do we set its type to the apporpriate value to enable accesses to the resource.

Note that once a slot is active, it is immutable with very few exceptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants