Skip to content

Move some of Controller's global state to the worker module#2361

Merged
stevenengler merged 4 commits intoshadow:mainfrom
stevenengler:split-controller
Aug 18, 2022
Merged

Move some of Controller's global state to the worker module#2361
stevenengler merged 4 commits intoshadow:mainfrom
stevenengler:split-controller

Conversation

@stevenengler
Copy link
Copy Markdown
Contributor

The Controller is currently globally accessible through the global worker pool, but since the controller exists on the stack, this is not allowed in rust (unless we use Box::leak). This breaks out some of the global state into a new global object. Accesses to this global state is made explicit through a worker::WORKER_SHARED static variable.

@stevenengler stevenengler added the Component: Main Composing the core Shadow executable label Aug 16, 2022
@stevenengler stevenengler self-assigned this Aug 16, 2022
The controller is currently globally accessible through the global worker pool,
but since the controller exists on the stack, this is not allowed in rust. This
breaks out some of the global state into a new global object. Accesses to this
global state is made explicit through a `worker::WORKER_SHARED` static
variable.
@stevenengler stevenengler merged commit 177e4dc into shadow:main Aug 18, 2022
@stevenengler stevenengler deleted the split-controller branch August 18, 2022 17:07
stevenengler added a commit to stevenengler/shadow that referenced this pull request Aug 18, 2022
stevenengler added a commit that referenced this pull request Aug 18, 2022
Fixed warning about unneeded `unsafe` from #2361
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Main Composing the core Shadow executable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants