-
Notifications
You must be signed in to change notification settings - Fork 72
5.6 Concurrency #196
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
5.6 Concurrency #196
Conversation
@tatsuya6502 レビューお願いします。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KeenS 2点コメントしました。ご確認をお願いします。
|
||
<!-- Calling `clone()` on an `Rc<T>` will return a new owned reference and bump the --> | ||
<!-- internal reference count. We create one of these for each thread: --> | ||
`Rc<T>` に対して `clone()` を呼ぶと新たな所有権を持った参照を返し、内部の参照カウント数を増やします。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
細かい話ですが、reference count の訳が、「リファレンスカウント」と「参照カウント」の2つに揺れています。対訳表では「参照カウント」になっていますので、そちらに統一するのがよいかと思います。
ただ、ひょっとすると、Rc が "reference count" の頭文字であることがわかるように、あえて「リファレンスカウント」としているのでしょうか? もしそうなら、たとえば、以下のようにするのはどうでしょうか?(さらに、"of its name" も取り入れてみました)
通常、この用途には `Rc<T>` を使います。これは所有権の共有を提供する参照カウントの型です。
実行時にある程度の管理コストを払って、値への参照の数をカウントします。
なので名前に参照カウント(reference count) が付いているのです。
`Rc<T>` に対して `clone()` を呼ぶと新たな所有権を持った参照を返し、内部の参照カウント数を増やします。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
参照カウントとすべきところですね。直します。
|
||
<!-- In essence, `Arc<T>` is a type that lets us share ownership of data _across --> | ||
<!-- threads_. --> | ||
要点は `Arc<T>` は _スレッド間_ で所有権を共有可能にする方ということです。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「方」→「型」
指摘箇所以外にももう1つ参照カウントがリファレンスカウントになってる箇所があったので修正しました。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KeenS 修正ありがとうございました。レビューOKですので、マージします。
おつかれさまでした!
No description provided.