bio
 
Loading...
Searching...
No Matches
bio_options_t Struct Reference

Initialization options. More...

#include <bio.h>

Data Fields

bio_allocator_t allocator
 Custom allocator. Defaults to stdlib if not provided.
 
int num_cls_buckets
 Number of coroutine-local storage (CLS) hash buckets.
 
struct { 
 
   int   num_threads 
 Number of threads in the thread pool. More...
 
   int   queue_size 
 The length of the message queue for each thread in the async thread poo. More...
 
thread_pool 
 Asynchronous thread pool options.
 
bio_log_options_t log_options
 Logging options.
 
bio_linux_options_t linux
 Linux-specific options, ignored on other platforms.
 
bio_windows_options_t windows
 Windows-specific options, ignored on other platforms.
 
bio_freebsd_options_t freebsd
 FreeBSD-specific options, ignored on other platforms.
 

Detailed Description

Initialization options.

All fields are optional and have default values. It is valid to call bio_init like this:

void bio_init(const bio_options_t *options)
Initialize the framework.
Initialization options.
Definition bio.h:408

Or with NULL:

bio_init(NULL);

You can also change just selected options:

.thread_pool = {
.num_threads = 8, // Use more threads
}
});
See also
bio_init

Field Documentation

◆ allocator

bio_allocator_t bio_options_t::allocator

Custom allocator. Defaults to stdlib if not provided.

◆ freebsd

bio_freebsd_options_t bio_options_t::freebsd

FreeBSD-specific options, ignored on other platforms.

◆ linux

bio_linux_options_t bio_options_t::linux

Linux-specific options, ignored on other platforms.

◆ log_options

bio_log_options_t bio_options_t::log_options

Logging options.

◆ num_cls_buckets

int bio_options_t::num_cls_buckets

Number of coroutine-local storage (CLS) hash buckets.

Defaults to BIO_DEFAULT_NUM_CLS_BUCKETS if not provided.

Internally, a hash table is used to keep track of the CLS in each coroutine. The buckets are only allocated when a coroutine calls bio_get_cls. A larger value will consume more memory but CLS lookup would be faster.

See also
bio_get_cls

◆ num_threads

int bio_options_t::num_threads

Number of threads in the thread pool.

Defaults to BIO_DEFAULT_THREAD_POOL_SIZE if not set.

◆ queue_size

int bio_options_t::queue_size

The length of the message queue for each thread in the async thread poo.

Defaults to BIO_DEFAULT_THREAD_POOL_QUEUE_SIZE if not set.

A larger value would consume more memory upfront but it will allow the main thread to submit more async jobs before being stalled.

◆ [struct]

struct { ... } bio_options_t::thread_pool

Asynchronous thread pool options.

See also
bio_run_async

◆ windows

bio_windows_options_t bio_options_t::windows

Windows-specific options, ignored on other platforms.


The documentation for this struct was generated from the following file: