tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pserialize(9) vs. TAILQ
Taylor R Campbell <campbell+netbsd-tech-kern%mumble.net@localhost> wrote:
> Date: Fri, 21 Nov 2014 18:25:02 +0800
> From: Dennis Ferguson <dennis.c.ferguson%gmail.com@localhost>
>
> Beyond the Alpha-barrier, he only thing I find lacking about the
> membar_*() API is maybe a set of functions that would eliminate the
> #ifndef/#endif around
>
> #ifndef __HAVE_ATOMIC_AS_MEMBAR
> membar_foo();
> #endif
>
> repeated over and over when synchronization is done via atomic_ops(3).
>
> I've been meaning to add preatomic_membar_foo/postatomic_membar_foo to
> address this, since finding typos in the cpp conditional that went
> undetected for years.
>
> Not sure it's necessary to distinguish the pre/post cases -- Linux
> does with smp_mb__before_atomic/smp_mb__after_atomic, but I'm not sure
> that distinction is needed for all our membar_foos, and I haven't
> taken the time to research the situation adequately.
I would rather extend atomic_ops(3) API to have functions which ensure
a particular memory barrier or a function which takes the constraint as
an extra argument, like in C11 API. Speaking of which, it might be worth
to evaluate C11 atomics and consider whether we should just move there..
--
Mindaugas
Home |
Main Index |
Thread Index |
Old Index