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. | ||
Initialization options.
All fields are optional and have default values. It is valid to call bio_init like this:
Or with NULL
:
You can also change just selected options:
bio_allocator_t bio_options_t::allocator |
Custom allocator. Defaults to stdlib if not provided.
bio_freebsd_options_t bio_options_t::freebsd |
FreeBSD-specific options, ignored on other platforms.
bio_linux_options_t bio_options_t::linux |
Linux-specific options, ignored on other platforms.
bio_log_options_t bio_options_t::log_options |
Logging options.
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.
int bio_options_t::num_threads |
Number of threads in the thread pool.
Defaults to BIO_DEFAULT_THREAD_POOL_SIZE if not set.
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 { ... } bio_options_t::thread_pool |
Asynchronous thread pool options.
bio_windows_options_t bio_options_t::windows |
Windows-specific options, ignored on other platforms.