- 
                Notifications
    You must be signed in to change notification settings 
- Fork 186
Description
It is currently not possible in Rust to safely define non thread-safe Wakers.  They are defined to be Send and Sync, and thereby the RawWakers must fulfill those guarantees.
This commit, as well as the general Waker implementation for glommio tasks violate those properties.
Non thread-safe Wakers had been part of the earlier async/await design in form a so called LocalWaker. However they had been removed from the design in order to simplify it, which unfortunately makes life a bit harder (or slower) for projects like this.
In addition to this Context is also Sync, which is something that wasn't initially planned for and probably still should be fixed.
You might want to consider a different wakeup mechansism than directly referencing the tasks via non-thread safe pointers. The original RFC mentioned an alternative implementation using thread-local storage and task IDs which could work. However there is also a drawback with this design: It would never allow for non-local wakeups, since the executor on the other thread would not be found (which might however be less of an issue for this project).