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

Add cow::ReadScope #107

Closed
brson opened this issue Oct 11, 2012 · 2 comments
Closed

Add cow::ReadScope #107

brson opened this issue Oct 11, 2012 · 2 comments

Comments

@brson
Copy link
Contributor

@brson brson commented Oct 11, 2012

ReadScope will address two unsafe aspects of COW: 1) Handles that exist after the cow::Scope is destroyed segfault when used; 2) There is no enforcement of owneship over the aux pointers, leading to races and other badness if they are used from multiple tasks.

We will begin assuming that there is only a single writer task and a single reader task (at any given time). Multiple readers are handled with a patient parent solution.

There will be a WriteScope and, at any given time, 0 or 1 ReadScopes. The write scope cannot be destroyed until after the outstanding ReadScope is destroyed, enforced with messages in destructors. A new ReadScope is created every time layout is performed. The existence of a ReadScope takes the place of reader_forked/reader_joined, eliminating another source of error.

To prevent sharing of aux pointers we will do several things:

  1. Make ReadScope un-sendable
  2. Give the WriteScope a ReadScopeTaskKey that indicates which task may use a ReadScope.
  3. Creating the ReadScope will need to be done through an affine ReadScopeFactory instance that contains the key.
  4. Exactly what happens when the reader fails is unclear. There needs to be a safe way to clean up the aux pointers and indicate to the WriteScope that the ReadScopeTaskKey can be changed.
@brson
Copy link
Contributor Author

@brson brson commented Oct 11, 2012

This also prevents writers from using reader pointers since the task key will prevent the writer from instantiating the ReadScope.

@metajack
Copy link
Contributor

@metajack metajack commented Apr 5, 2013

No more cow.

@metajack metajack closed this Apr 5, 2013
ChrisParis pushed a commit to ChrisParis/servo that referenced this issue Sep 7, 2014
Pointer Events: Ported jQuery submission from mercurial.
glennw added a commit to glennw/servo that referenced this issue Jan 16, 2017
Unbind WebGL context before creating the frame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.