Skip to content

Convert Thread to Rust#2752

Merged
sporksmith merged 3 commits intoshadow:mainfrom
sporksmith:thread-rust3
Feb 21, 2023
Merged

Convert Thread to Rust#2752
sporksmith merged 3 commits intoshadow:mainfrom
sporksmith:thread-rust3

Conversation

@sporksmith
Copy link
Copy Markdown
Contributor

No description provided.

@sporksmith sporksmith self-assigned this Feb 16, 2023
@github-actions github-actions bot added Component: Build Build/install tools and dependencies Component: Main Composing the core Shadow executable labels Feb 16, 2023
@sporksmith sporksmith changed the title Thread rust3 Convert Thread to Rust Feb 16, 2023
@sporksmith sporksmith mentioned this pull request Feb 17, 2023
Since in the planned design we don't intend to use mutable references to
Thread, I thought we could omit the RootedRefCell wrapper here. We
*could*, but without it we need to make Thread itself Sync, which means
that for interior mutability we end up needing to use e.g. RootedCell
instead of just Cell, and RootedRefCell instead of just RefCell. That in
turn requires callers of most of Thread's methods to provide a Root.

I think it'll be simpler (and maybe more performant) to just wrap the
Thread itself in RootedRefCell, in which case Thread only needs to be
Send, but doesn't need to be Sync.
@sporksmith sporksmith enabled auto-merge February 21, 2023 22:41
@sporksmith sporksmith merged commit 3fe2726 into shadow:main Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Build Build/install tools and dependencies Component: Main Composing the core Shadow executable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants