Skip to content

Implement Sync for process::Command #72387

Closed

Description

@jonhoo

std::process::Command is currently Send, but not Sync. While Sync probably isn't super useful for Command itself, it does mean that any type that wraps a process::Command also isn't Sync even if it might be useful on that type.

Command currently has a manual impl Send following #47760 (issue #47751), though from the discussion on users.r-l.o, it sounds like a manual impl Sync would also be sound. @cuviper not sure if that still holds?

If it does, this seems like a worthwhile impl to add, simply for the auto-trait implications.

Activity

  1. jonhoo commented on May 20, 2020

    @jonhoo
    ContributorAuthor

    To give one example of where this crops up: tokio::process::Command currently isn't Sync because std::process::Command isn't Sync. This also means that any async fn that uses tokio::process::Command across an await point is not Sync. Again, the ramifications of that probably aren't too severe (how important is it that a Future is Sync?), but it does lead to some annoyance when trying to use that future with libraries that just stick Send + Sync bounds wherever to get rid of compiler errors 😅

  2. cuviper commented on May 20, 2020

    @cuviper
    Member

    As with Send, I think it's just the argv that isn't Sync, but that should be fine to add.

  3. added
    T-libs-api[DEPRECATED; DO NOT USE]
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    and removed
    C-bugCategory: This is a bug.
    on May 20, 2020
  4. added a commit that references this issue on May 25, 2020
    5a26be3
  5. added a commit that references this issue on May 25, 2020
    2679c38
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

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions