Re: [PATCH v1 0/2] Add support for print exactly once

FUJITA Tomonori
2025-11-14T01:12:23Z

On Thu, 13 Nov 2025 16:57:18 -0800
Boqun Feng <boqun.feng@gmail.com> wrote:

> On Fri, Nov 14, 2025 at 09:47:30AM +0900, FUJITA Tomonori wrote:
> [...]
>> >> Using u8 as atomic type instead of i32 would require a fair amount of
>> >> work, since at the moment only i32 and i64 are supported as atomic
>> >> types, right?
>> >
>> > Supporting u8 atomics in general is tricky, but I think *specifically*
>> > load/store should not be a problem.
>>
>> You meant using read_volatile/write_volatile? Since we only need
>> "Relaxed" order so something like the following?
>>
>> #[repr(transparent)]
>> struct AtomicU8(UnsafeCell<u8>);
>>
>
> Please don't. Please make it work with Atomic<T>, also store release and
> load acquire should be introduced as well.

I wanted to confirm what kind of u8 load/store implementation Alice
has in mind, and whether it would be used only for OnceLite.

Of course. If we add something like that to kernel/sync, I agree that
it should be implemented in that way. If not, I'm not sure.