File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -71,12 +71,21 @@ Major exceptions include:
71
71
* ` UnsafeCell ` は Sync を実装していません (そしてそれ故に ` Cell ` も ` RefCell ` も同様です) 。
72
72
* ` Rc ` は Send も Sync も実装していません (なぜなら参照カウントが共有され、これは同期されないからです) 。
73
73
74
+ <!--
74
75
`Rc` and `UnsafeCell` are very fundamentally not thread-safe: they enable
75
76
unsynchronized shared mutable state. However raw pointers are, strictly
76
77
speaking, marked as thread-unsafe as more of a *lint*. Doing anything useful
77
78
with a raw pointer requires dereferencing it, which is already unsafe. In that
78
79
sense, one could argue that it would be "fine" for them to be marked as thread
79
80
safe.
81
+ -->
82
+
83
+ ` Rc ` と ` UnsafeCell ` は本当に根本的にスレッドセーフではありません。すなわち、
84
+ これらは、同期されていない共有可変状態を実現できてしまうからです。しかしながら、
85
+ 生ポインタは、厳密に言えば、* リント* において、より一層スレッドアンセーフです。
86
+ 生ポインタで何か有益なことをしようとすれば、参照外しをする必要があるため、
87
+ もう既にアンセーフです。その意味で、これらをスレッドセーフとしてマークしても
88
+ "問題ない" と論じることも可能と言えるでしょう。
80
89
81
90
However it's important that they aren't thread safe to prevent types that
82
91
contain them from being automatically marked as thread safe. These types have
You can’t perform that action at this time.
0 commit comments