Core Module#

The Core module provides the fundamental building blocks and runtime primitives for the Join framework. It includes networking, concurrency, I/O, and utility components.


๐ŸŒ Networking#

MAC Address#

48-bit MAC address representation with parsing, formatting, and comparison.

IP Address#

IP address abstraction supporting both IPv4 and IPv6: parsing, formatting, network and broadcast address calculation, and comparison.

Endpoints#

Network endpoint representation combining an IP address and a port, with support for both address families.

Protocol#

Protocol definitions and type system for the different socket kinds.

Sockets#

Socket abstractions for various protocols:

  • TCP โ€” stream-oriented reliable connections
  • UDP โ€” connectionless datagram protocol
  • TLS/SSL โ€” encrypted secure communications
  • Unix Domain โ€” inter-process communication (stream and datagram)
  • Raw โ€” direct IP packet access
  • ICMP โ€” Internet Control Message Protocol
  • Netlink โ€” Linux kernel communication

Acceptors#

Server-side socket abstractions for accepting incoming connections: TCP, TLS, and Unix stream.

Socket Streams#

Buffered stream interface for sockets with std::iostream integration, including stream operators (<<, >>).


โšก Reactor#

Event-driven I/O multiplexing built on Linux epoll:

  • Reactor โ€” embeddable event loop; call run() to start, stop() to terminate
  • ReactorThread โ€” singleton wrapper that owns a Reactor on a dedicated background thread
  • EventHandler โ€” interface for I/O event callbacks (onReceive, onClose, onError)

See Reactor for full documentation.


๐Ÿงต Threading & Concurrency#

Thread#

POSIX thread wrapper with core affinity, real-time priority, move semantics, non-blocking join (tryJoin), and running state query.

See Thread for full documentation.

Thread Pool#

Worker pool for parallel task execution. Default worker count is based on CpuTopology (physical core count). Provides distribute() and parallelForEach() parallel algorithms.

See Thread Pool for full documentation.

CPU Topology#

Runtime detector for the physical CPU layout: sockets, cores, hardware threads (SMT/HT), and NUMA nodes. Read from Linux sysfs. Used internally by ThreadPool and distribute().

See CPU Topology for full documentation.

Mutex#

  • Mutex โ€” standard mutual exclusion lock
  • RecursiveMutex โ€” re-entrant locking for the same thread
  • SharedMutex โ€” inter-process synchronization via shared memory

Condition Variables#

  • Condition โ€” standard condition variable
  • SharedCondition โ€” condition variable for shared memory

Semaphore#

  • Semaphore โ€” counting semaphore (named and unnamed)
  • SharedSemaphore โ€” semaphore for shared memory

๐Ÿ”„ Lock-Free Queues & Allocator#

High-performance lock-free primitives built on top of the memory backends:

  • Spsc โ€” single-producer / single-consumer queue (lowest overhead)
  • Mpsc โ€” multi-producer / single-consumer queue
  • Mpmc โ€” multi-producer / multi-consumer queue
  • BasicArena โ€” lock-free slab allocator with multiple fixed-size pools

Backed by either LocalMem (anonymous private memory) or ShmMem (POSIX shared memory). Supports blocking and non-blocking push/pop, NUMA binding, and memory locking.

See Memory, Queue, Allocator, and Backoff for full documentation.


โฑ๏ธ Timers#

High-resolution timers built on Linux timerfd, integrated with the reactor:

  • Monotonic::Timer โ€” uses CLOCK_MONOTONIC, unaffected by system clock changes
  • RealTime::Timer โ€” uses CLOCK_REALTIME, follows wall-clock adjustments

Supports one-shot, absolute time-point, and periodic modes. Nanosecond precision.

See Timer for full documentation.


๐Ÿ—‚๏ธ Utilities#

File System#

File I/O helpers, path manipulation, and file status queries.

Variant#

Type-safe union implementation with exception-safe operations and comparison operators.

Traits#

Compile-time type utilities: parameter pack manipulation (find_index, find_element, match_t), type checking (is_unique, is_alternative, count), and constructor control (EnableDefault).

Utils#

General-purpose utilities: byte order conversion, string manipulation (trim, split, replace, case-insensitive compare), benchmarking, and random generation.

OpenSSL#

OpenSSL library management and RAII smart pointer wrappers.


๐Ÿšจ Error Handling#

Custom error handling system: error category, thread-local error state (join::lastError), integration with std::error_code, and OpenSSL error integration.


๐Ÿ“š API Reference#

Doxygen Reference