Ripples 1.0
High Performant Software Architecture For Transaction Processing
Loading...
Searching...
No Matches
Vectorloop

Detailed Description

Vectorloop is function that processes queries. It runs in a dedicated thread. Multiple vectorloop threads could be started (configurable).

Vectorloop is designed to process data as sets (vectors) hence optimizing CPU cache hits and minimizing context switching.

Data Structures

struct  vectorloop_s
 

Typedefs

typedef struct vectorloop_s vectorloop_t
 

Functions

vectorloop_tvl_new (config_t *cfg, int id, channel_bss_t *res_ch, channel_log_t *app_log_channel, channel_bss_t *query_log_channel, metrics_t *metrics)
 
void * vl_run (void *arg)
 

Typedef Documentation

◆ vectorloop_t

typedef struct vectorloop_s vectorloop_t

Structure represents a VectorLoop.

Function Documentation

◆ vl_new()

vectorloop_t * vl_new ( config_t cfg,
int  id,
channel_bss_t res_ch,
channel_log_t app_log_channel,
channel_bss_t query_log_channel,
metrics_t metrics 
)

Create a new vectorloop object

Parameters
cfgConfiguration with settings.
idVectorloop ID.
res_chResource channel used for this vectorloop.
app_log_channelApplication log channel used for this vectorloop.
query_log_channelQuery log channel used for this vectorloop.
metricsMetrics object vectorloop to use.
Returns
Returns newly created vectorloop object.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vl_run()

void * vl_run ( void *  arg)

Main Vectorloop function (loop) that receives DNS queries, processes then, sends and logs responses.

This is a continuous loop that slows it self down if there was no data to process. Slowdown is done so we do not run CPU hot needlessly. Policy is to slow down (sleep) after 8 iteration by 10us, then 8 more iterations by 50us, then by 1ms. from there on. If data is received the slowdown loop stages start over.

Parameters
argPointer to vectorloop object to run. Argument is of type void* as this function is invoked by pthread_create().
Returns
NULL pointer returned upon termination.
Here is the call graph for this function:
Here is the caller graph for this function: