The thread_aware crate currently provides a lot of wiring for implementors of thread-aware types but there is not an obvious entry point to direct users to for "how do I treat a thread-aware type". We should have an easy to link documentation page somewhere that says things like:
- A thread-aware type should not be manually moved across threads (e.g. by capturing in a
thread::spawn() or tokio::spawn() closure) on penalty of suboptimal performance and efficiency.
- A thread-aware type should instead by moved across threads by <ERROR: I have no idea what to write here that is valid as a generic statement>
- How to recognize a thread-aware type?
- How to recognize that a thread-aware type is correctly used?
- What to watch out for in code reviews?
Ultimately, I want a single link I can drop into a # Multithreaded use chapter in my thread-aware type's API documentation and that will tell the users all about how to properly handle such a type.
The
thread_awarecrate currently provides a lot of wiring for implementors of thread-aware types but there is not an obvious entry point to direct users to for "how do I treat a thread-aware type". We should have an easy to link documentation page somewhere that says things like:thread::spawn()ortokio::spawn()closure) on penalty of suboptimal performance and efficiency.Ultimately, I want a single link I can drop into a
# Multithreaded usechapter in my thread-aware type's API documentation and that will tell the users all about how to properly handle such a type.