Comments (3)
You are right. The same probably also applies to other Future
s. I now recall a discussion on discord (or somewhere else?) where the question was whether Waker
s should actually be updated. I think some mentioned "no", but strictly speaking it's the right thing to do. I will push an update.
I am not sure whether you can really move the Future
between tasks. It at least has to be pinned, and thereby it is already very restricted what you can do with it. Executors will likely always be passing the same Waker
, but it's better not to rely on it.
will_wake()
sounds good to avoid the refcount churn - but I just discovered that it's broken due to the executor optimizations: Those sometimes pass a different Waker
reference which only on .clone()
gets transformed into the real Waker
. E.g. futures-rs does it here. That saves the refcount increase and decrease on the executor - but now causes will_wake()
to always return false
.
from futures-intrusive.
I am not sure whether you can really move the Future between tasks.
It is possible, but I'm not sure you'd ever really see it in "normal" code. You could for example make a future that contains a Pin<Box<impl Future>>
, polls it once and then sends it on a channel to a task running on another executor.
from futures-intrusive.
This should be fixed now. I checked all Pending
returns and added updates for the Waker
.
from futures-intrusive.
Related Issues (20)
- Channels with growing capacity HOT 2
- GenericSemaphoreAcquireFuture isn't Sync HOT 7
- `Semaphore` cost O(waiters) time to wake up on, and quadratic in total HOT 2
- Channel::close should return previous state
- Unwind safety HOT 4
- shared::OneshotReceiver and cancellation HOT 2
- GenericOneshotBroadcastReceiver incorrectly requires MutexType to be Clone HOT 4
- LocalChannel backed by non-ArrayBuf RingBuf HOT 2
- NoopLock is unsound HOT 7
- Update `parking_lot` and `lock_api` HOT 1
- Pulling out intrusive data structures into another crate HOT 2
- GenericMutexGuard should be marked !Sync HOT 3
- Cut New Release With Updated Dependencies HOT 1
- Does this crate alias mutable references? HOT 1
- Maintenance Status HOT 1
- Possible breaking change in 0.4.1 release HOT 2
- Test failures in Fedora packaging HOT 2
- Use alloc instead of std HOT 2
- Support a shared Semaphor HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from futures-intrusive.