ZXC 0.15.0
High-performance asymmetric lossless compression library
Loading...
Searching...
No Matches
zxc_threads.h File Reference

POSIX-shaped threading layer shared by the stream engine (zxc_driver.c) and the seekable reader (zxc_seekable.c). More...

#include "zxc_internal.h"
#include <pthread.h>
#include <unistd.h>

Go to the source code of this file.

Functions

static int zxc_num_procs (void)
 Returns the number of online logical processors.
 

Detailed Description

POSIX-shaped threading layer shared by the stream engine (zxc_driver.c) and the seekable reader (zxc_seekable.c).

On POSIX this is <pthread.h> verbatim. On Windows it maps the handful of primitives both engines use onto the Win32 API under their POSIX names, so one body of threading logic compiles everywhere. Include this instead of <pthread.h>.

Definition in file zxc_threads.h.

Function Documentation

◆ zxc_num_procs()

static int zxc_num_procs ( void  )
inlinestatic

Returns the number of online logical processors.

Returns
_SC_NPROCESSORS_ONLN, clamped to a minimum of 1 if the query fails.

Definition at line 135 of file zxc_threads.h.

Referenced by zxc_seekable_decompress_range_mt(), and zxc_stream_engine_start().