@@ -16646,25 +16646,31 @@ msgstr ""
16646
16646
16647
16647
#: src/concurrency/send-sync.md:1
16648
16648
msgid "`Send` and `Sync`"
16649
- msgstr ""
16649
+ msgstr "`Send`と`Sync` "
16650
16650
16651
16651
#: src/concurrency/send-sync.md:3
16652
16652
msgid ""
16653
16653
"How does Rust know to forbid shared access across thread? The answer is in "
16654
16654
"two traits:"
16655
16655
msgstr ""
16656
+ "Rustはどのようにスレッド間での値の共有アクセスを禁止するのでしょうか?その答"
16657
+ "えとなるのが、以下の2つのトレイトです:"
16656
16658
16657
16659
#: src/concurrency/send-sync.md:5
16658
16660
msgid ""
16659
16661
"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` "
16660
16662
"is `Send` if it is safe to move a `T` across a thread boundary."
16661
16663
msgstr ""
16664
+ "[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): スレッド境界"
16665
+ "をまたいでの型`T`のムーブが安全に行える場合、型`T`は`Send`である。"
16662
16666
16663
16667
#: src/concurrency/send-sync.md:7
16664
16668
msgid ""
16665
16669
"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` "
16666
16670
"is `Sync` if it is safe to move a `&T` across a thread boundary."
16667
16671
msgstr ""
16672
+ "[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): スレッド境界"
16673
+ "をまたいで`&T`のムーブが安全に行える場合、型`T`は`Sync`である。"
16668
16674
16669
16675
#: src/concurrency/send-sync.md:10
16670
16676
msgid ""
@@ -16673,16 +16679,24 @@ msgid ""
16673
16679
"contain `Send` and `Sync` types. You can also implement them manually when "
16674
16680
"you know it is valid."
16675
16681
msgstr ""
16682
+ "`Send`と`Sync`は[unsafeなトレイト](../unsafe/unsafe-traits.md)です。 あなたが"
16683
+ "新たに定義する型が`Send`と`Sync`の型のみを含む場合、コンパイラはその新しい型"
16684
+ "に対して`Send`と`Sync`を自動的に導出します。そうでなくても妥当であるならば"
16685
+ "`Send`と`Sync`を自分自身で実装することもできます。"
16676
16686
16677
16687
#: src/concurrency/send-sync.md:20
16678
16688
msgid ""
16679
16689
"One can think of these traits as markers that the type has certain thread-"
16680
16690
"safety properties."
16681
16691
msgstr ""
16692
+ "これらのトレイトは、ある型が特定のスレッドセーフの特性を持っていることを示す"
16693
+ "マーカーと考えることもできます。"
16682
16694
16683
16695
#: src/concurrency/send-sync.md:21
16684
16696
msgid "They can be used in the generic constraints as normal traits."
16685
16697
msgstr ""
16698
+ "これらは通常のトレイトと同じように、ジェネリック境界の中で利用することができ"
16699
+ "ます。"
16686
16700
16687
16701
#: src/concurrency/send-sync/send.md:1
16688
16702
msgid "`Send`"
@@ -16693,19 +16707,26 @@ msgid ""
16693
16707
"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) "
16694
16708
"if it is safe to move a `T` value to another thread."
16695
16709
msgstr ""
16710
+ "型`T`の値を安全に別のスレッドにムーブできる場合、型`T`は[`Send`](https://doc."
16711
+ "rust-lang.org/std/marker/trait.Send.html)である。"
16696
16712
16697
16713
#: src/concurrency/send-sync/send.md:5
16698
16714
msgid ""
16699
16715
"The effect of moving ownership to another thread is that _destructors_ will "
16700
16716
"run in that thread. So the question is when you can allocate a value in one "
16701
16717
"thread and deallocate it in another."
16702
16718
msgstr ""
16719
+ "所有権を別のスレットにムーブするということは、_デストラクタ_ がそのスレッドで"
16720
+ "実行されるということです。つまり、あるスレッドでアロケートされた値を別のス"
16721
+ "レッドで解放しても良いかというのが判断基準になります。"
16703
16722
16704
16723
#: src/concurrency/send-sync/send.md:13
16705
16724
msgid ""
16706
16725
"As an example, a connection to the SQLite library must only be accessed from "
16707
16726
"a single thread."
16708
16727
msgstr ""
16728
+ "例を挙げると、SQLiteライブラリへのコネクションは、一つのスレッドからのみアク"
16729
+ "セスされる必要があります。"
16709
16730
16710
16731
#: src/concurrency/send-sync/sync.md:1
16711
16732
msgid "`Sync`"
@@ -16716,21 +16737,25 @@ msgid ""
16716
16737
"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) "
16717
16738
"if it is safe to access a `T` value from multiple threads at the same time."
16718
16739
msgstr ""
16740
+ "型`T`の値を複数のスレッドから同時にアクセスしても安全な場合、型`T`は [`Sync`]"
16741
+ "(https://doc.rust-lang.org/std/marker/trait.Sync.html) である。"
16719
16742
16720
16743
#: src/concurrency/send-sync/sync.md:6
16721
16744
msgid "More precisely, the definition is:"
16722
- msgstr ""
16745
+ msgstr "より正確には、以下のような定義です: "
16723
16746
16724
16747
#: src/concurrency/send-sync/sync.md:8
16725
16748
msgid "`T` is `Sync` if and only if `&T` is `Send`"
16726
- msgstr ""
16749
+ msgstr "`&T`が`Send`である場合、かつその場合に限り、`T`は`Sync`である "
16727
16750
16728
16751
#: src/concurrency/send-sync/sync.md:14
16729
16752
msgid ""
16730
16753
"This statement is essentially a shorthand way of saying that if a type is "
16731
16754
"thread-safe for shared use, it is also thread-safe to pass references of it "
16732
16755
"across threads."
16733
16756
msgstr ""
16757
+ "これはつまり、「ある型の共有がスレッドセーフであれば、その参照をスレッド間で"
16758
+ "受け渡すこともスレッドセーフである」ということを手短に表したものです。"
16734
16759
16735
16760
#: src/concurrency/send-sync/sync.md:16
16736
16761
msgid ""
@@ -16740,14 +16765,19 @@ msgid ""
16740
16765
"is also safe to move to another thread, because the data it references can "
16741
16766
"be accessed from any thread safely."
16742
16767
msgstr ""
16768
+ "なぜなら、ある型がSyncである場合、データ競合や他の同期の問題などのリスクなし"
16769
+ "にその型を複数のスレッド間で共有でき、その型を別のスレッドにムーブしても安全"
16770
+ "だからです。また、型への参照は別のスレッドにムーブしても安全です。それは、そ"
16771
+ "れが参照するデータは任意のスレッドから安全にアクセスすることができるからで"
16772
+ "す。"
16743
16773
16744
16774
#: src/concurrency/send-sync/examples.md:3
16745
16775
msgid "`Send + Sync`"
16746
16776
msgstr ""
16747
16777
16748
16778
#: src/concurrency/send-sync/examples.md:5
16749
16779
msgid "Most types you come across are `Send + Sync`:"
16750
- msgstr ""
16780
+ msgstr "見かけるほとんどの型は`Send + Sync`です: "
16751
16781
16752
16782
#: src/concurrency/send-sync/examples.md:7
16753
16783
msgid "`i8`, `f32`, `bool`, `char`, `&str`, ..."
@@ -16763,21 +16793,23 @@ msgstr ""
16763
16793
16764
16794
#: src/concurrency/send-sync/examples.md:10
16765
16795
msgid "`Arc<T>`: Explicitly thread-safe via atomic reference count."
16766
- msgstr ""
16796
+ msgstr "`Arc<T>`: アトミック参照カウントにより、明示的にスレッドセーフ。 "
16767
16797
16768
16798
#: src/concurrency/send-sync/examples.md:11
16769
16799
msgid "`Mutex<T>`: Explicitly thread-safe via internal locking."
16770
- msgstr ""
16800
+ msgstr "`Mutex<T>`: 内部ロックにより明示的にスレッドセーフ。 "
16771
16801
16772
16802
#: src/concurrency/send-sync/examples.md:12
16773
16803
msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions."
16774
- msgstr ""
16804
+ msgstr "`AtomicBool`, `AtomicU8`, …: 特別なアトミック命令を利用。 "
16775
16805
16776
16806
#: src/concurrency/send-sync/examples.md:14
16777
16807
msgid ""
16778
16808
"The generic types are typically `Send + Sync` when the type parameters are "
16779
16809
"`Send + Sync`."
16780
16810
msgstr ""
16811
+ "ジェネリクスは、型パラメタが`Send + Sync`であるとき、通常は`Send + Sync`で"
16812
+ "す。"
16781
16813
16782
16814
#: src/concurrency/send-sync/examples.md:17
16783
16815
msgid "`Send + !Sync`"
@@ -16788,6 +16820,8 @@ msgid ""
16788
16820
"These types can be moved to other threads, but they're not thread-safe. "
16789
16821
"Typically because of interior mutability:"
16790
16822
msgstr ""
16823
+ "これらの型は別のスレッドにムーブすることができますが、このようなムーブはス"
16824
+ "レッドセーフではありません。通常は内部可変性がその原因です:"
16791
16825
16792
16826
#: src/concurrency/send-sync/examples.md:22
16793
16827
msgid "`mpsc::Sender<T>`"
@@ -16813,12 +16847,16 @@ msgstr ""
16813
16847
msgid ""
16814
16848
"These types are thread-safe, but they cannot be moved to another thread:"
16815
16849
msgstr ""
16850
+ "このような型はスレッドセーフですが、別のスレッドにムーブすることはできませ"
16851
+ "ん:"
16816
16852
16817
16853
#: src/concurrency/send-sync/examples.md:31
16818
16854
msgid ""
16819
16855
"`MutexGuard<T>`: Uses OS level primitives which must be deallocated on the "
16820
16856
"thread which created them."
16821
16857
msgstr ""
16858
+ "`MutexGuard<T>`: プリミティブを作成したスレッド自身により、割り当てを解除され"
16859
+ "るべきであるようなOSレベルのプリミティブを利用。"
16822
16860
16823
16861
#: src/concurrency/send-sync/examples.md:34
16824
16862
msgid "`!Send + !Sync`"
@@ -16827,18 +16865,24 @@ msgstr ""
16827
16865
#: src/concurrency/send-sync/examples.md:36
16828
16866
msgid "These types are not thread-safe and cannot be moved to other threads:"
16829
16867
msgstr ""
16868
+ "このような型はスレッドセーフではないため、別のスレッドにムーブすることはでき"
16869
+ "ません:"
16830
16870
16831
16871
#: src/concurrency/send-sync/examples.md:38
16832
16872
msgid ""
16833
16873
"`Rc<T>`: each `Rc<T>` has a reference to an `RcBox<T>`, which contains a non-"
16834
16874
"atomic reference count."
16835
16875
msgstr ""
16876
+ "`Rc<T>`: それぞれの `Rc<T>` は`RcBox<T>`への参照を持っています。これは、アト"
16877
+ "ミックでない参照カウントを持っています。"
16836
16878
16837
16879
#: src/concurrency/send-sync/examples.md:40
16838
16880
msgid ""
16839
16881
"`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency "
16840
16882
"considerations."
16841
16883
msgstr ""
16884
+ "`*const T`, `*mut T`: Rust は、生ポインターは同時実行性に関する特別な考慮事項"
16885
+ "がある可能性があることを仮定しています。"
16842
16886
16843
16887
#: src/concurrency/shared_state.md:3
16844
16888
msgid ""
0 commit comments