From eb55eea6c631d9414d349b43044a6e06c4c1943d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 16 Jun 2014 13:05:55 -0700 Subject: [PATCH 1/3] RFC: Rename Share to Threadsafe --- active/0000-share-to-threadsafe.md | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 active/0000-share-to-threadsafe.md diff --git a/active/0000-share-to-threadsafe.md b/active/0000-share-to-threadsafe.md new file mode 100644 index 00000000000..7814d36c075 --- /dev/null +++ b/active/0000-share-to-threadsafe.md @@ -0,0 +1,49 @@ +- Start Date: 2014-06-15 +- RFC PR #: (leave this empty) +- Rust Issue #: (leave this empty) + +# Summary + +Rename the `Share` trait to `Threadsafe`. + +# 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 `Threadsafe`. Documentation would +refer to `&T` as a shared reference and the notion of "shared" would simply mean +"many references" while `Threadsafe` implies that it is safe to share among many +threads. + +# Drawbacks + +The name `Threadsafe` may imply that a type is itself always safe to use +concurrently. While it is impossible to safely have *data races*, it is possible +to safely have *race conditions*. The name `Threadsafe` may imply that a type +has no race conditions, which is not quite accurate. + +Additionally, the name `Threadsafe` is 5 letters longer than `Share`, which is a +little unfortunate. + +# Alternatives + +As any bikeshed, there are a number of other names which could be possible for +this trait: + +* `Conurrent` +* `Synchronized` +* `Parallel` +* `Threaded` +* `Atomic` +* `DataRaceFree` +* `ConcurrentlySharable` + +# Unresolved questions + +None. From 512bc7fa1c9470e4c324bed9ad69cab9b9a48a86 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 16 Jun 2014 13:09:26 -0700 Subject: [PATCH 2/3] Fix spelling of concurrent --- active/0000-share-to-threadsafe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/active/0000-share-to-threadsafe.md b/active/0000-share-to-threadsafe.md index 7814d36c075..da72b560c85 100644 --- a/active/0000-share-to-threadsafe.md +++ b/active/0000-share-to-threadsafe.md @@ -36,7 +36,7 @@ little unfortunate. As any bikeshed, there are a number of other names which could be possible for this trait: -* `Conurrent` +* `Concurrent` * `Synchronized` * `Parallel` * `Threaded` From 1484eb420b0d5f37a7d2828413159a7c22ccb66e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 22 Jul 2014 14:35:20 -0700 Subject: [PATCH 3/3] Rename Threadsafe to Sync --- active/0000-share-to-threadsafe.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/active/0000-share-to-threadsafe.md b/active/0000-share-to-threadsafe.md index da72b560c85..a60933ca850 100644 --- a/active/0000-share-to-threadsafe.md +++ b/active/0000-share-to-threadsafe.md @@ -4,7 +4,7 @@ # Summary -Rename the `Share` trait to `Threadsafe`. +Rename the `Share` trait to `Sync` # Motivation @@ -16,20 +16,16 @@ concurrently with a shared reference. # Detailed design -Rename the `Share` trait in `std::kinds` to `Threadsafe`. Documentation would +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 `Threadsafe` implies that it is safe to share among many +"many references" while `Sync` implies that it is safe to share among many threads. # Drawbacks -The name `Threadsafe` may imply that a type is itself always safe to use -concurrently. While it is impossible to safely have *data races*, it is possible -to safely have *race conditions*. The name `Threadsafe` may imply that a type -has no race conditions, which is not quite accurate. - -Additionally, the name `Threadsafe` is 5 letters longer than `Share`, which is a -little unfortunate. +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 @@ -38,6 +34,7 @@ this trait: * `Concurrent` * `Synchronized` +* `Threadsafe` * `Parallel` * `Threaded` * `Atomic`