@@ -16646,25 +16646,31 @@ msgstr ""
1664616646
1664716647#: src/concurrency/send-sync.md:1
1664816648msgid "`Send` and `Sync`"
16649- msgstr ""
16649+ msgstr "`Send`と`Sync` "
1665016650
1665116651#: src/concurrency/send-sync.md:3
1665216652msgid ""
1665316653"How does Rust know to forbid shared access across thread? The answer is in "
1665416654"two traits:"
1665516655msgstr ""
16656+ "Rustはどのようにスレッド間での値の共有アクセスを禁止するのでしょうか?その答"
16657+ "えとなるのが、以下の2つのトレイトです:"
1665616658
1665716659#: src/concurrency/send-sync.md:5
1665816660msgid ""
1665916661"[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` "
1666016662"is `Send` if it is safe to move a `T` across a thread boundary."
1666116663msgstr ""
16664+ "[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): スレッド境界"
16665+ "をまたいでの型`T`のムーブが安全に行える場合、型`T`は`Send`である。"
1666216666
1666316667#: src/concurrency/send-sync.md:7
1666416668msgid ""
1666516669"[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` "
1666616670"is `Sync` if it is safe to move a `&T` across a thread boundary."
1666716671msgstr ""
16672+ "[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): スレッド境界"
16673+ "をまたいで`&T`のムーブが安全に行える場合、型`T`は`Sync`である。"
1666816674
1666916675#: src/concurrency/send-sync.md:10
1667016676msgid ""
@@ -16673,16 +16679,24 @@ msgid ""
1667316679"contain `Send` and `Sync` types. You can also implement them manually when "
1667416680"you know it is valid."
1667516681msgstr ""
16682+ "`Send`と`Sync`は[unsafeなトレイト](../unsafe/unsafe-traits.md)です。 あなたが"
16683+ "新たに定義する型が`Send`と`Sync`の型のみを含む場合、コンパイラはその新しい型"
16684+ "に対して`Send`と`Sync`を自動的に導出します。そうでなくても妥当であるならば"
16685+ "`Send`と`Sync`を自分自身で実装することもできます。"
1667616686
1667716687#: src/concurrency/send-sync.md:20
1667816688msgid ""
1667916689"One can think of these traits as markers that the type has certain thread-"
1668016690"safety properties."
1668116691msgstr ""
16692+ "これらのトレイトは、ある型が特定のスレッドセーフの特性を持っていることを示す"
16693+ "マーカーと考えることもできます。"
1668216694
1668316695#: src/concurrency/send-sync.md:21
1668416696msgid "They can be used in the generic constraints as normal traits."
1668516697msgstr ""
16698+ "これらは通常のトレイトと同じように、ジェネリック境界の中で利用することができ"
16699+ "ます。"
1668616700
1668716701#: src/concurrency/send-sync/send.md:1
1668816702msgid "`Send`"
@@ -16693,19 +16707,26 @@ msgid ""
1669316707"A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) "
1669416708"if it is safe to move a `T` value to another thread."
1669516709msgstr ""
16710+ "型`T`の値を安全に別のスレッドにムーブできる場合、型`T`は[`Send`](https://doc."
16711+ "rust-lang.org/std/marker/trait.Send.html)である。"
1669616712
1669716713#: src/concurrency/send-sync/send.md:5
1669816714msgid ""
1669916715"The effect of moving ownership to another thread is that _destructors_ will "
1670016716"run in that thread. So the question is when you can allocate a value in one "
1670116717"thread and deallocate it in another."
1670216718msgstr ""
16719+ "所有権を別のスレットにムーブするということは、_デストラクタ_ がそのスレッドで"
16720+ "実行されるということです。つまり、あるスレッドでアロケートされた値を別のス"
16721+ "レッドで解放しても良いかというのが判断基準になります。"
1670316722
1670416723#: src/concurrency/send-sync/send.md:13
1670516724msgid ""
1670616725"As an example, a connection to the SQLite library must only be accessed from "
1670716726"a single thread."
1670816727msgstr ""
16728+ "例を挙げると、SQLiteライブラリへのコネクションは、一つのスレッドからのみアク"
16729+ "セスされる必要があります。"
1670916730
1671016731#: src/concurrency/send-sync/sync.md:1
1671116732msgid "`Sync`"
@@ -16716,21 +16737,25 @@ msgid ""
1671616737"A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) "
1671716738"if it is safe to access a `T` value from multiple threads at the same time."
1671816739msgstr ""
16740+ "型`T`の値を複数のスレッドから同時にアクセスしても安全な場合、型`T`は [`Sync`]"
16741+ "(https://doc.rust-lang.org/std/marker/trait.Sync.html) である。"
1671916742
1672016743#: src/concurrency/send-sync/sync.md:6
1672116744msgid "More precisely, the definition is:"
16722- msgstr ""
16745+ msgstr "より正確には、以下のような定義です: "
1672316746
1672416747#: src/concurrency/send-sync/sync.md:8
1672516748msgid "`T` is `Sync` if and only if `&T` is `Send`"
16726- msgstr ""
16749+ msgstr "`&T`が`Send`である場合、かつその場合に限り、`T`は`Sync`である "
1672716750
1672816751#: src/concurrency/send-sync/sync.md:14
1672916752msgid ""
1673016753"This statement is essentially a shorthand way of saying that if a type is "
1673116754"thread-safe for shared use, it is also thread-safe to pass references of it "
1673216755"across threads."
1673316756msgstr ""
16757+ "これはつまり、「ある型の共有がスレッドセーフであれば、その参照をスレッド間で"
16758+ "受け渡すこともスレッドセーフである」ということを手短に表したものです。"
1673416759
1673516760#: src/concurrency/send-sync/sync.md:16
1673616761msgid ""
@@ -16740,14 +16765,19 @@ msgid ""
1674016765"is also safe to move to another thread, because the data it references can "
1674116766"be accessed from any thread safely."
1674216767msgstr ""
16768+ "なぜなら、ある型がSyncである場合、データ競合や他の同期の問題などのリスクなし"
16769+ "にその型を複数のスレッド間で共有でき、その型を別のスレッドにムーブしても安全"
16770+ "だからです。また、型への参照は別のスレッドにムーブしても安全です。それは、そ"
16771+ "れが参照するデータは任意のスレッドから安全にアクセスすることができるからで"
16772+ "す。"
1674316773
1674416774#: src/concurrency/send-sync/examples.md:3
1674516775msgid "`Send + Sync`"
1674616776msgstr ""
1674716777
1674816778#: src/concurrency/send-sync/examples.md:5
1674916779msgid "Most types you come across are `Send + Sync`:"
16750- msgstr ""
16780+ msgstr "見かけるほとんどの型は`Send + Sync`です: "
1675116781
1675216782#: src/concurrency/send-sync/examples.md:7
1675316783msgid "`i8`, `f32`, `bool`, `char`, `&str`, ..."
@@ -16763,21 +16793,23 @@ msgstr ""
1676316793
1676416794#: src/concurrency/send-sync/examples.md:10
1676516795msgid "`Arc<T>`: Explicitly thread-safe via atomic reference count."
16766- msgstr ""
16796+ msgstr "`Arc<T>`: アトミック参照カウントにより、明示的にスレッドセーフ。 "
1676716797
1676816798#: src/concurrency/send-sync/examples.md:11
1676916799msgid "`Mutex<T>`: Explicitly thread-safe via internal locking."
16770- msgstr ""
16800+ msgstr "`Mutex<T>`: 内部ロックにより明示的にスレッドセーフ。 "
1677116801
1677216802#: src/concurrency/send-sync/examples.md:12
1677316803msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions."
16774- msgstr ""
16804+ msgstr "`AtomicBool`, `AtomicU8`, …: 特別なアトミック命令を利用。 "
1677516805
1677616806#: src/concurrency/send-sync/examples.md:14
1677716807msgid ""
1677816808"The generic types are typically `Send + Sync` when the type parameters are "
1677916809"`Send + Sync`."
1678016810msgstr ""
16811+ "ジェネリクスは、型パラメタが`Send + Sync`であるとき、通常は`Send + Sync`で"
16812+ "す。"
1678116813
1678216814#: src/concurrency/send-sync/examples.md:17
1678316815msgid "`Send + !Sync`"
@@ -16788,6 +16820,8 @@ msgid ""
1678816820"These types can be moved to other threads, but they're not thread-safe. "
1678916821"Typically because of interior mutability:"
1679016822msgstr ""
16823+ "これらの型は別のスレッドにムーブすることができますが、このようなムーブはス"
16824+ "レッドセーフではありません。通常は内部可変性がその原因です:"
1679116825
1679216826#: src/concurrency/send-sync/examples.md:22
1679316827msgid "`mpsc::Sender<T>`"
@@ -16813,12 +16847,16 @@ msgstr ""
1681316847msgid ""
1681416848"These types are thread-safe, but they cannot be moved to another thread:"
1681516849msgstr ""
16850+ "このような型はスレッドセーフですが、別のスレッドにムーブすることはできませ"
16851+ "ん:"
1681616852
1681716853#: src/concurrency/send-sync/examples.md:31
1681816854msgid ""
1681916855"`MutexGuard<T>`: Uses OS level primitives which must be deallocated on the "
1682016856"thread which created them."
1682116857msgstr ""
16858+ "`MutexGuard<T>`: プリミティブを作成したスレッド自身により、割り当てを解除され"
16859+ "るべきであるようなOSレベルのプリミティブを利用。"
1682216860
1682316861#: src/concurrency/send-sync/examples.md:34
1682416862msgid "`!Send + !Sync`"
@@ -16827,18 +16865,24 @@ msgstr ""
1682716865#: src/concurrency/send-sync/examples.md:36
1682816866msgid "These types are not thread-safe and cannot be moved to other threads:"
1682916867msgstr ""
16868+ "このような型はスレッドセーフではないため、別のスレッドにムーブすることはでき"
16869+ "ません:"
1683016870
1683116871#: src/concurrency/send-sync/examples.md:38
1683216872msgid ""
1683316873"`Rc<T>`: each `Rc<T>` has a reference to an `RcBox<T>`, which contains a non-"
1683416874"atomic reference count."
1683516875msgstr ""
16876+ "`Rc<T>`: それぞれの `Rc<T>` は`RcBox<T>`への参照を持っています。これは、アト"
16877+ "ミックでない参照カウントを持っています。"
1683616878
1683716879#: src/concurrency/send-sync/examples.md:40
1683816880msgid ""
1683916881"`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency "
1684016882"considerations."
1684116883msgstr ""
16884+ "`*const T`, `*mut T`: Rust は、生ポインターは同時実行性に関する特別な考慮事項"
16885+ "がある可能性があることを仮定しています。"
1684216886
1684316887#: src/concurrency/shared_state.md:3
1684416888msgid ""
0 commit comments