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

refactor: per-worker resource table #3306

Merged
merged 6 commits into from
Nov 14, 2019

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Nov 9, 2019

Blocked by #3290

This PR:

  • removes global RESOURCE_TABLE - resource tables are now created per Worker in State
  • renames CliResource to StreamResource and moves all logic related to it to cli/ops/io.rs
  • removes cli/resources.rs
  • adds state argument to op_read and op_write and consequently adds stateful_minimal_op to State
  • IMPORTANT NOTE: workers don't have access to process stdio - this is caused by fact that dropping worker would close stdout for process (because it's constructed from raw handle, which closes underlying file descriptor on drop)

@bartlomieju bartlomieju changed the title [WIP] refactor: per-worker resource table refactor: per-worker resource table Nov 9, 2019
@bartlomieju
Copy link
Member Author

CC @ry @piscisaureus

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - this is a great improvement over the global resource table. I'm slightly concerned about the impact on the benchmarks - but let's see what happens. Very nice refactor!

@ry ry merged commit fd62379 into denoland:master Nov 14, 2019
ry added a commit to ry/deno that referenced this pull request Nov 14, 2019
ry added a commit to ry/deno that referenced this pull request Nov 14, 2019
This patch does not work with the recent bundler changes (denoland#3325).
Unfortunately I didn't merge master before landing this patch. It has
something to do with console.log not working inside the compiler worker.

This reverts commit fd62379.
ry added a commit that referenced this pull request Nov 14, 2019
This patch does not work with the recent bundler changes (#3325).
Unfortunately I didn't merge master before landing this patch. It has
something to do with console.log not working inside the compiler worker.

This reverts commit fd62379.
@bartlomieju bartlomieju deleted the refactor-state_resource_table branch December 2, 2019 13:19
bartlomieju added a commit to bartlomieju/deno that referenced this pull request Dec 28, 2019
- removes global `RESOURCE_TABLE` - resource tables are now created per `Worker`
  in `State`
- renames `CliResource` to `StreamResource` and moves all logic related
  to it to `cli/ops/io.rs`
- removes `cli/resources.rs`
- adds `state` argument to `op_read` and `op_write` and consequently adds
  `stateful_minimal_op` to `State`
- IMPORTANT NOTE: workers don't have access to process stdio - this is
  caused by fact that dropping worker would close stdout for process
  (because it's constructed from raw handle, which closes underlying file
  descriptor on drop)
bartlomieju pushed a commit to bartlomieju/deno that referenced this pull request Dec 28, 2019
This patch does not work with the recent bundler changes (denoland#3325).
Unfortunately I didn't merge master before landing this patch. It has
something to do with console.log not working inside the compiler worker.

This reverts commit fd62379.
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

Successfully merging this pull request may close these issues.

2 participants