Skip to content

Tighten watch::{Sender, Receiver} cross-thread bounds to T: Send + Sync before 1.0 #456

Open

Description

@tisonkun

Summary

watch::{Sender, Receiver} currently implement Send and Sync when T: Send, because reading clones &T behind an internal exclusive Mutex. In #451, channel metadata (version, terminal disconnection state, and endpoint counts) and waiter registration were moved out of that mutex while preserving T: Send compatibility across 0.8.x.

Before 1.0 (in a coordinated 0.9 / 1.0 breaking release), evaluate tightening watch::{Sender, Receiver} cross-thread bounds to T: Send + Sync (matching tokio::sync::watch and Asyncband's other shared-read primitives such as RwLock, OnceCell, and LazyCell) so concurrent readers can inspect &T snapshots without serializing behind an exclusive value mutex, while verifying small-payload multi-threaded read throughput does not regress on reader-count atomic contention.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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