Electroneum
ub_ctx Struct Reference

#include <context.h>

Collaboration diagram for ub_ctx:

Public Attributes

lock_basic_type qqpipe_lock
 
struct tubeqq_pipe
 
lock_basic_type rrpipe_lock
 
struct tuberr_pipe
 
lock_basic_type cfglock
 
int finalized
 
int created_bg
 
pid_t bg_pid
 
ub_thread_type bg_tid
 
int dothread
 
int thr_next_num
 
int logfile_override
 
FILE * log_out
 
struct alloc_cachealloc_list
 
struct alloc_cache superalloc
 
struct module_envenv
 
struct module_stack mods
 
struct local_zoneslocal_zones
 
struct ub_randstate * seed_rnd
 
struct ub_event_baseevent_base
 
struct libworkerevent_worker
 
int next_querynum
 
size_t num_async
 
rbtree_type queries
 

Detailed Description

The context structure

Contains two pipes for async service qq : write queries to the async service pid/tid. rr : read results from the async service pid/tid.

Definition at line 62 of file context.h.

Member Data Documentation

◆ alloc_list

struct alloc_cache* ub_ctx::alloc_list

List of alloc-cache-id points per threadnum for notinuse threads. Simply the entire struct alloc_cache with the 'super' member used to link a simply linked list. Reset super member to the superalloc before use.

Definition at line 104 of file context.h.

◆ bg_pid

pid_t ub_ctx::bg_pid

pid of bg worker process

Definition at line 86 of file context.h.

◆ bg_tid

ub_thread_type ub_ctx::bg_tid

tid of bg worker thread

Definition at line 88 of file context.h.

◆ cfglock

lock_basic_type ub_ctx::cfglock

mutex for access to env.cfg, finalized and dothread

Definition at line 75 of file context.h.

◆ created_bg

int ub_ctx::created_bg

is bg worker created yet ?

Definition at line 84 of file context.h.

◆ dothread

int ub_ctx::dothread

do threading (instead of forking) for async resolution

Definition at line 91 of file context.h.

◆ env

struct module_env* ub_ctx::env

module env master value

Definition at line 109 of file context.h.

◆ event_base

struct ub_event_base* ub_ctx::event_base

event base for event oriented interface

Definition at line 118 of file context.h.

◆ event_worker

struct libworker* ub_ctx::event_worker

libworker for event based interface

Definition at line 120 of file context.h.

◆ finalized

int ub_ctx::finalized

The context has been finalized This is after config when the first resolve is done. The modules are inited (module-init()) and shared caches created.

Definition at line 81 of file context.h.

◆ local_zones

struct local_zones* ub_ctx::local_zones

local authority zones

Definition at line 113 of file context.h.

◆ log_out

FILE* ub_ctx::log_out

what logfile to use instead

Definition at line 97 of file context.h.

◆ logfile_override

int ub_ctx::logfile_override

if logfile is overridden

Definition at line 95 of file context.h.

◆ mods

struct module_stack ub_ctx::mods

module stack

Definition at line 111 of file context.h.

◆ next_querynum

int ub_ctx::next_querynum

next query number (to try) to use

Definition at line 123 of file context.h.

◆ num_async

size_t ub_ctx::num_async

number of async queries outstanding

Definition at line 125 of file context.h.

◆ qq_pipe

struct tube* ub_ctx::qq_pipe

the query write pipe

Definition at line 67 of file context.h.

◆ qqpipe_lock

lock_basic_type ub_ctx::qqpipe_lock

mutex on query write pipe

Definition at line 65 of file context.h.

◆ queries

rbtree_type ub_ctx::queries

Tree of outstanding queries. Indexed by querynum Used when results come in for async to lookup. Used when cancel is done for lookup (and delete). Used to see if querynum is free for use. Content of type ctx_query.

Definition at line 133 of file context.h.

◆ rr_pipe

struct tube* ub_ctx::rr_pipe

the result read pipe

Definition at line 71 of file context.h.

◆ rrpipe_lock

lock_basic_type ub_ctx::rrpipe_lock

mutex on result read pipe

Definition at line 69 of file context.h.

◆ seed_rnd

struct ub_randstate* ub_ctx::seed_rnd

random state used to seed new random state structures

Definition at line 115 of file context.h.

◆ superalloc

struct alloc_cache ub_ctx::superalloc

shared caches, and so on

Definition at line 107 of file context.h.

◆ thr_next_num

int ub_ctx::thr_next_num

next thread number for new threads

Definition at line 93 of file context.h.


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