unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OpenBSD-5.7)
Page:
Section:
Apropos / Subsearch:
optional field

MEMBAR(9)                BSD Kernel Developer's Manual               MEMBAR(9)

NAME
     membar_enter, membar_exit, membar_producer, membar_consumer, membar_sync
     -- memory access barrier operations

SYNOPSIS
     #include <&lt;sys/atomic.h>&gt;

     void
     membar_enter(void);

     void
     membar_exit(void);

     void
     membar_producer(void);

     void
     membar_consumer(void);

     void
     membar_sync(void);

DESCRIPTION
     The membar set of functions provide an interface for issuing memory bar-
     rier access operations with respect to multiple processors in the system.

     membar_enter()
          Any store preceding membar_enter() will reach global visibility
          before all loads and stores following it.

          membar_enter() is typically used in code that implements locking
          primitives to ensure that a lock protects its data.

     membar_exit()
          All loads and stores preceding membar_exit() will reach global visi-
          bility before any store that follows it.

          membar_exit() is typically used in code that implements locking
          primitives to ensure that a lock protects its data.

     membar_producer()
          All stores preceding the memory barrier will reach global visibility
          before any stores after the memory barrier reach global visibility.

     membar_consumer()
          All loads preceding the memory barrier will complete before any
          loads after the memory barrier complete.

     membar_sync()
          All loads and stores preceding the memory barrier will complete and
          reach global visibility before any loads and stores after the memory
          barrier complete and reach global visibility.

CONTEXT
     membar_enter(), membar_exit(), membar_producer(), membar_consumer(),
     membar_sync() can all be called during autoconf, from process context, or
     from interrupt context.

HISTORY
     The membar functions first appeared in NetBSD 5.0 and OpenBSD 5.5.

BSD                            February 14, 2014                           BSD