Skip to content

Reactor::wait_for takes &Pollable instead of Pollable#28

Closed
pchickey wants to merge 1 commit intomainfrom
pch/wait_for_ref_pollable
Closed

Reactor::wait_for takes &Pollable instead of Pollable#28
pchickey wants to merge 1 commit intomainfrom
pch/wait_for_ref_pollable

Conversation

@pchickey
Copy link
Contributor

We want to be able to reuse a pollable on many uses in the reactor.

The fundamental underlying operation wasi:io/poll.poll takes a list<borrow<pollable>>, or &[&Pollable] in Rust.

The Poller structure needs to be changed to unsafe transmute the &Pollable to a common lifetime for passing to poll. This remains safe as long as each caller that inserts a &Pollable unconditionally removes it.

We want to be able to reuse a pollable on many uses in the reactor.

The fundamental underlying operation `wasi:io/poll.poll` takes a `list<borrow<pollable>>`, or `&[&Pollable]` in Rust.

The `Poller` structure needs to be changed to unsafe transmute the `&Pollable` to a common lifetime for passing to `poll`. This remains safe as long as each caller that inserts a `&Pollable` unconditionally removes it.
@pchickey pchickey force-pushed the pch/wait_for_ref_pollable branch from 6f78a41 to c740f1b Compare November 26, 2024 02:18
@pchickey pchickey marked this pull request as draft November 26, 2024 02:35
@pchickey
Copy link
Contributor Author

This was not the way to go, I figured it out in #35

@pchickey pchickey closed this Dec 12, 2024
@pchickey pchickey deleted the pch/wait_for_ref_pollable branch December 20, 2024 18:54
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.

1 participant