Skip to content

docs: Clarify how users are meant to treat thread-aware types #276

@sandersaares

Description

@sandersaares

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:

  1. 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.
  2. 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>
  3. How to recognize a thread-aware type?
  4. How to recognize that a thread-aware type is correctly used?
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions