jaulib v1.3.0
Jau Support Library (C++, Java, ..)
Classes | Typedefs | Functions
Concurrency

Concurrency support to avoid data races and help to synchronize access. More...

Classes

class  jau::latch
 Inspired by std::latch of C++20. More...
 
struct  jau::ordered_atomic< _Tp, _MO >
 std::atomic<T> type with predefined fixed std::memory_order, not allowing changing the memory model on usage and applying the set order to all operator. More...
 
class  jau::sc_atomic_critical
 This class provides a RAII-style Sequentially Consistent (SC) data race free (DRF) critical block. More...
 
class  jau::service_runner
 Service runner, a reusable dedicated thread performing custom user services. More...
 
class  jau::simple_timer
 A simple timer for timeout and interval applications, using one dedicated service_runner thread per instance. More...
 

Typedefs

typedef ordered_atomic< bool, std::memory_order_relaxed > jau::relaxed_atomic_bool
 Relaxed non-SC atomic integral scalar boolean. More...
 
typedef ordered_atomic< int, std::memory_order_relaxed > jau::relaxed_atomic_int
 Relaxed non-SC atomic integral scalar integer. More...
 
typedef ordered_atomic< int16_t, std::memory_order_relaxed > jau::relaxed_atomic_int16
 Relaxed non-SC atomic integral scalar int16_t. More...
 
typedef ordered_atomic< int32_t, std::memory_order_relaxed > jau::relaxed_atomic_int32
 Relaxed non-SC atomic integral scalar int32_t. More...
 
typedef ordered_atomic< int64_t, std::memory_order_relaxed > jau::relaxed_atomic_int64
 Relaxed non-SC atomic integral scalar int64_t. More...
 
typedef ordered_atomic< int8_t, std::memory_order_relaxed > jau::relaxed_atomic_int8
 Relaxed non-SC atomic integral scalar int8_t. More...
 
typedef ordered_atomic< jau::nsize_t, std::memory_order_relaxed > jau::relaxed_atomic_nsize_t
 Relaxed non-SC atomic integral scalar jau::nsize_t. More...
 
typedef ordered_atomic< std::size_t, std::memory_order_relaxed > jau::relaxed_atomic_size_t
 Relaxed non-SC atomic integral scalar size_t. More...
 
typedef ordered_atomic< jau::snsize_t, std::memory_order_relaxed > jau::relaxed_atomic_snsize_t
 Relaxed non-SC atomic integral scalar jau::snsize_t. More...
 
typedef ordered_atomic< ssize_t, std::memory_order_relaxed > jau::relaxed_atomic_ssize_t
 Relaxed non-SC atomic integral scalar ssize_t. More...
 
typedef ordered_atomic< uint16_t, std::memory_order_relaxed > jau::relaxed_atomic_uint16
 Relaxed non-SC atomic integral scalar uint16_t. More...
 
typedef ordered_atomic< uint32_t, std::memory_order_relaxed > jau::relaxed_atomic_uint32
 Relaxed non-SC atomic integral scalar uint32_t. More...
 
typedef ordered_atomic< uint64_t, std::memory_order_relaxed > jau::relaxed_atomic_uint64
 Relaxed non-SC atomic integral scalar uint64_t. More...
 
typedef ordered_atomic< uint8_t, std::memory_order_relaxed > jau::relaxed_atomic_uint8
 Relaxed non-SC atomic integral scalar uint8_t. More...
 
typedef ordered_atomic< bool, std::memory_order_seq_cst > jau::sc_atomic_bool
 SC atomic integral scalar boolean. More...
 
typedef ordered_atomic< int, std::memory_order_seq_cst > jau::sc_atomic_int
 SC atomic integral scalar integer. More...
 
typedef ordered_atomic< int16_t, std::memory_order_seq_cst > jau::sc_atomic_int16
 SC atomic integral scalar int16_t. More...
 
typedef ordered_atomic< int32_t, std::memory_order_seq_cst > jau::sc_atomic_int32
 SC atomic integral scalar int32_t. More...
 
typedef ordered_atomic< int64_t, std::memory_order_seq_cst > jau::sc_atomic_int64
 SC atomic integral scalar int64_t. More...
 
typedef ordered_atomic< int8_t, std::memory_order_seq_cst > jau::sc_atomic_int8
 SC atomic integral scalar int8_t. More...
 
typedef ordered_atomic< jau::nsize_t, std::memory_order_seq_cst > jau::sc_atomic_nsize_t
 SC atomic integral scalar jau::nsize_t. More...
 
typedef ordered_atomic< std::size_t, std::memory_order_seq_cst > jau::sc_atomic_size_t
 SC atomic integral scalar size_t. More...
 
typedef ordered_atomic< jau::snsize_t, std::memory_order_seq_cst > jau::sc_atomic_snsize_t
 SC atomic integral scalar jau::snsize_t. More...
 
typedef jau::ordered_atomic< ssize_t, std::memory_order_seq_cst > jau::sc_atomic_ssize_t
 SC atomic integral scalar ssize_t. More...
 
typedef ordered_atomic< uint16_t, std::memory_order_seq_cst > jau::sc_atomic_uint16
 SC atomic integral scalar uint16_t. More...
 
typedef ordered_atomic< uint32_t, std::memory_order_seq_cst > jau::sc_atomic_uint32
 SC atomic integral scalar uint32_t. More...
 
typedef ordered_atomic< uint64_t, std::memory_order_seq_cst > jau::sc_atomic_uint64
 SC atomic integral scalar uint64_t. More...
 
typedef ordered_atomic< uint8_t, std::memory_order_seq_cst > jau::sc_atomic_uint8
 SC atomic integral scalar uint8_t. More...
 

Functions

template<typename _Tp , std::memory_order _MO>
std::string jau::to_string (const ordered_atomic< _Tp, _MO > &ref)
 

Detailed Description

Concurrency support to avoid data races and help to synchronize access.

Notable, the following data structures from Data Structures are supporting concurrency:

Further, Fraction Arithmetic and Time are supporting concurrency:

Typedef Documentation

◆ sc_atomic_bool

typedef ordered_atomic<bool, std::memory_order_seq_cst> jau::sc_atomic_bool

SC atomic integral scalar boolean.

Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write)

Definition at line 239 of file ordered_atomic.hpp.

◆ relaxed_atomic_bool

typedef ordered_atomic<bool, std::memory_order_relaxed> jau::relaxed_atomic_bool

Relaxed non-SC atomic integral scalar boolean.

Memory-Model (MM) only guarantees the atomic value, no sequential consistency (SC) between acquire (read) and release (write).

Definition at line 242 of file ordered_atomic.hpp.

◆ sc_atomic_int8

typedef ordered_atomic<int8_t, std::memory_order_seq_cst> jau::sc_atomic_int8

SC atomic integral scalar int8_t.

Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write)

Definition at line 245 of file ordered_atomic.hpp.

◆ relaxed_atomic_int8

typedef ordered_atomic<int8_t, std::memory_order_relaxed> jau::relaxed_atomic_int8

Relaxed non-SC atomic integral scalar int8_t.

Memory-Model (MM) only guarantees the atomic value, no sequential consistency (SC) between acquire (read) and release (write).

Definition at line 248 of file ordered_atomic.hpp.

◆ sc_atomic_uint8

typedef ordered_atomic<uint8_t, std::memory_order_seq_cst> jau::sc_atomic_uint8

SC atomic integral scalar uint8_t.

Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write)

Definition at line 251 of file ordered_atomic.hpp.

◆ relaxed_atomic_uint8

typedef ordered_atomic<uint8_t, std::memory_order_relaxed> jau::relaxed_atomic_uint8

Relaxed non-SC atomic integral scalar uint8_t.

Memory-Model (MM) only guarantees the atomic value, no sequential consistency (SC) between acquire (read) and release (write).

Definition at line 254 of file ordered_atomic.hpp.

◆ sc_atomic_int16

typedef ordered_atomic<int16_t, std::memory_order_seq_cst> jau::sc_atomic_int16

SC atomic integral scalar int16_t.

Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write)

Definition at line 257 of file ordered_atomic.hpp.

◆ relaxed_atomic_int16

typedef ordered_atomic<int16_t, std::memory_order_relaxed> jau::relaxed_atomic_int16

Relaxed non-SC atomic integral scalar int16_t.

Memory-Model (MM) only guarantees the atomic value, no sequential consistency (SC) between acquire (read) and release (write).

Definition at line 260 of file ordered_atomic.hpp.

◆ sc_atomic_uint16

typedef ordered_atomic<uint16_t, std::memory_order_seq_cst> jau::sc_atomic_uint16

SC atomic integral scalar uint16_t.

Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write)

Definition at line 263 of file ordered_atomic.hpp.

◆ relaxed_atomic_uint16

typedef ordered_atomic<uint16_t, std::memory_order_relaxed> jau::relaxed_atomic_uint16

Relaxed non-SC atomic integral scalar uint16_t.

Memory-Model (MM) only guarantees the atomic value, no sequential consistency (SC) between acquire (read) and release (write).

Definition at line 266 of file ordered_atomic.hpp.

◆ sc_atomic_int

typedef ordered_atomic<int, std::memory_order_seq_cst> jau::sc_atomic_int

SC atomic integral scalar integer.

Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write)

Definition at line 269 of file ordered_atomic.hpp.

◆ relaxed_atomic_int

typedef ordered_atomic<int, std::memory_order_relaxed> jau::relaxed_atomic_int

Relaxed non-SC atomic integral scalar integer.

Memory-Model (MM) only guarantees the atomic value, no sequential consistency (SC) between acquire (read) and release (write).

Definition at line 272 of file ordered_atomic.hpp.

◆ sc_atomic_int32

typedef ordered_atomic<int32_t, std::memory_order_seq_cst> jau::sc_atomic_int32

SC atomic integral scalar int32_t.

Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write)

Definition at line 275 of file ordered_atomic.hpp.

◆ relaxed_atomic_int32

typedef ordered_atomic<int32_t, std::memory_order_relaxed> jau::relaxed_atomic_int32

Relaxed non-SC atomic integral scalar int32_t.

Memory-Model (MM) only guarantees the atomic value, no sequential consistency (SC) between acquire (read) and release (write).

Definition at line 278 of file ordered_atomic.hpp.

◆ sc_atomic_uint32

typedef ordered_atomic<uint32_t, std::memory_order_seq_cst> jau::sc_atomic_uint32

SC atomic integral scalar uint32_t.

Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write)

Definition at line 281 of file ordered_atomic.hpp.

◆ relaxed_atomic_uint32

typedef ordered_atomic<uint32_t, std::memory_order_relaxed> jau::relaxed_atomic_uint32

Relaxed non-SC atomic integral scalar uint32_t.

Memory-Model (MM) only guarantees the atomic value, no sequential consistency (SC) between acquire (read) and release (write).

Definition at line 284 of file ordered_atomic.hpp.

◆ sc_atomic_nsize_t

typedef ordered_atomic<jau::nsize_t, std::memory_order_seq_cst> jau::sc_atomic_nsize_t

SC atomic integral scalar jau::nsize_t.

Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write)

Definition at line 287 of file ordered_atomic.hpp.

◆ sc_atomic_snsize_t

typedef ordered_atomic<jau::snsize_t, std::memory_order_seq_cst> jau::sc_atomic_snsize_t

SC atomic integral scalar jau::snsize_t.

Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write)

Definition at line 290 of file ordered_atomic.hpp.

◆ relaxed_atomic_nsize_t

typedef ordered_atomic<jau::nsize_t, std::memory_order_relaxed> jau::relaxed_atomic_nsize_t

Relaxed non-SC atomic integral scalar jau::nsize_t.

Memory-Model (MM) only guarantees the atomic value, no sequential consistency (SC) between acquire (read) and release (write).

Definition at line 293 of file ordered_atomic.hpp.

◆ relaxed_atomic_snsize_t

typedef ordered_atomic<jau::snsize_t, std::memory_order_relaxed> jau::relaxed_atomic_snsize_t

Relaxed non-SC atomic integral scalar jau::snsize_t.

Memory-Model (MM) only guarantees the atomic value, no sequential consistency (SC) between acquire (read) and release (write).

Definition at line 296 of file ordered_atomic.hpp.

◆ sc_atomic_size_t

typedef ordered_atomic<std::size_t, std::memory_order_seq_cst> jau::sc_atomic_size_t

SC atomic integral scalar size_t.

Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write)

Definition at line 299 of file ordered_atomic.hpp.

◆ sc_atomic_ssize_t

typedef jau::ordered_atomic<ssize_t, std::memory_order_seq_cst> jau::sc_atomic_ssize_t

SC atomic integral scalar ssize_t.

Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write)

Definition at line 302 of file ordered_atomic.hpp.

◆ relaxed_atomic_size_t

typedef ordered_atomic<std::size_t, std::memory_order_relaxed> jau::relaxed_atomic_size_t

Relaxed non-SC atomic integral scalar size_t.

Memory-Model (MM) only guarantees the atomic value, no sequential consistency (SC) between acquire (read) and release (write).

Definition at line 305 of file ordered_atomic.hpp.

◆ relaxed_atomic_ssize_t

typedef ordered_atomic<ssize_t, std::memory_order_relaxed> jau::relaxed_atomic_ssize_t

Relaxed non-SC atomic integral scalar ssize_t.

Memory-Model (MM) only guarantees the atomic value, no sequential consistency (SC) between acquire (read) and release (write).

Definition at line 308 of file ordered_atomic.hpp.

◆ sc_atomic_int64

typedef ordered_atomic<int64_t, std::memory_order_seq_cst> jau::sc_atomic_int64

SC atomic integral scalar int64_t.

Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write)

Definition at line 311 of file ordered_atomic.hpp.

◆ relaxed_atomic_int64

typedef ordered_atomic<int64_t, std::memory_order_relaxed> jau::relaxed_atomic_int64

Relaxed non-SC atomic integral scalar int64_t.

Memory-Model (MM) only guarantees the atomic value, no sequential consistency (SC) between acquire (read) and release (write).

Definition at line 314 of file ordered_atomic.hpp.

◆ sc_atomic_uint64

typedef ordered_atomic<uint64_t, std::memory_order_seq_cst> jau::sc_atomic_uint64

SC atomic integral scalar uint64_t.

Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write)

Definition at line 317 of file ordered_atomic.hpp.

◆ relaxed_atomic_uint64

typedef ordered_atomic<uint64_t, std::memory_order_relaxed> jau::relaxed_atomic_uint64

Relaxed non-SC atomic integral scalar uint64_t.

Memory-Model (MM) only guarantees the atomic value, no sequential consistency (SC) between acquire (read) and release (write).

Definition at line 320 of file ordered_atomic.hpp.

Function Documentation

◆ to_string()

template<typename _Tp , std::memory_order _MO>
std::string jau::to_string ( const ordered_atomic< _Tp, _MO > &  ref)

Definition at line 233 of file ordered_atomic.hpp.