From: Alice Ryhl <aliceryhl@google.com>
To: boqun.feng@gmail.com
Cc: alex.gaynor@gmail.com, aliceryhl@google.com,
benno.lossin@proton.me, bjorn3_gh@protonmail.com,
gary@garyguo.net, linux-kernel@vger.kernel.org,
mark.rutland@arm.com, mingo@redhat.com, ojeda@kernel.org,
patches@lists.linux.dev, peterz@infradead.org,
rust-for-linux@vger.kernel.org, wedsonaf@gmail.com,
will@kernel.org
Subject: Re: [PATCH v1 1/2] rust: specify when `ARef` is thread safe
Date: Fri, 19 May 2023 09:42:14 +0000 [thread overview]
Message-ID: <20230519094214.3433619-1-aliceryhl@google.com> (raw)
In-Reply-To: <ZGaXdS+psZoEZBMr@boqun-archlinux>
On 5/18/23 23:24, Boqun Feng wrote:
> On Wed, May 17, 2023 at 09:59:04AM +0000, Alice Ryhl wrote:
>> +// SAFETY: It is safe to send `ARef<T>` to another thread when the underlying `T` is `Sync` because
>> +// it effectively means sharing `&T` (which is safe because `T` is `Sync`); additionally, it needs
>> +// `T` to be `Send` because any thread that has an `ARef<T>` may ultimately access `T` directly, for
>
> Does the "ultimately access `T` directly" here imply mutably or
> exclusively? If so, it makes sense to me to call it out. I'm trying to
> make sure we can agree on some "common terminologies" ;)
It means "access using a mutable reference". I agree that "directly" is a bit
unclear - I copied it from the safety comment on Arc.
Alice
next prev parent reply other threads:[~2023-05-19 9:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 9:59 Alice Ryhl
2023-05-17 9:59 ` [PATCH v1 2/2] rust: task: add `Send` marker to `Task` Alice Ryhl
2023-05-23 13:27 ` Andreas Hindborg
2023-05-18 21:24 ` [PATCH v1 1/2] rust: specify when `ARef` is thread safe Boqun Feng
2023-05-19 9:42 ` Alice Ryhl [this message]
2023-05-23 13:11 ` Andreas Hindborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230519094214.3433619-1-aliceryhl@google.com \
--to=aliceryhl@google.com \
--cc=alex.gaynor@gmail.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=ojeda@kernel.org \
--cc=patches@lists.linux.dev \
--cc=peterz@infradead.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=wedsonaf@gmail.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®