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

ZeroCopyBuf and MagicBuffer should not be Send or Sync #129

Open
andreubotella opened this issue Oct 6, 2021 · 2 comments
Open

ZeroCopyBuf and MagicBuffer should not be Send or Sync #129

andreubotella opened this issue Oct 6, 2021 · 2 comments

Comments

@andreubotella
Copy link
Contributor

ZeroCopyBuf wraps a reference to a backing store that is potentially shared with an ArrayBuffer object, and thus is only safely accessible from one thread. Therefore, ZeroCopyBuf, and MagicBuffer which wraps it, must not be Send or Sync – yet they are both. In fact, ZeroCopyBuf unsafely implements Send, even though that is not needed – which seems to be a holdover from previous iterations of this API.

Once denoland/deno#12678 is solved, it might be possible to allow a way safely send ZeroCopyBuf values, as long as their backing store was created for a SharedArrayBuffer – but implementing Send directly on ZeroCopyBuf would still not be sound. We can tackle this when the time comes.

See also denoland/rusty_v8#798.

This was discovered when investigating denoland/deno#12341.

@AaronO AaronO transferred this issue from denoland/serde_v8 Nov 7, 2021
@stale
Copy link

stale bot commented Jan 7, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot closed this as completed Jan 14, 2022
@kitsonk
Copy link

kitsonk commented Jan 14, 2022

I don't know why you are doing this stalebot... you should be ashamed... 😖

@kitsonk kitsonk reopened this Jan 14, 2022
@bartlomieju bartlomieju transferred this issue from denoland/deno Aug 6, 2023
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

2 participants