Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Rename Share to Sync #123

Merged
merged 3 commits into from
Aug 5, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions active/0000-share-to-threadsafe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
- Start Date: 2014-06-15
- RFC PR #: (leave this empty)
- Rust Issue #: (leave this empty)

# Summary

Rename the `Share` trait to `Sync`

# Motivation

With interior mutability, the name "immutable pointer" for a value of type `&T`
is not quite accurate. Instead, the term "shared reference" is becoming popular
to reference values of type `&T`. The usage of the term "shared" is in conflict
with the `Share` trait, which is intended for types which can be safely shared
concurrently with a shared reference.

# Detailed design

Rename the `Share` trait in `std::kinds` to `Sync`. Documentation would
refer to `&T` as a shared reference and the notion of "shared" would simply mean
"many references" while `Sync` implies that it is safe to share among many
threads.

# Drawbacks

The name `Sync` may invoke conceptions of "synchronized" from languages such as
Java where locks are used, rather than meaning "safe to access in a shared
fashion across tasks".

# Alternatives

As any bikeshed, there are a number of other names which could be possible for
this trait:

* `Concurrent`
* `Synchronized`
* `Threadsafe`
* `Parallel`
* `Threaded`
* `Atomic`
* `DataRaceFree`
* `ConcurrentlySharable`

# Unresolved questions

None.