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.
◆ vectorloop_t
Structure represents a VectorLoop.
◆ vl_new()
Create a new vectorloop object
- Parameters
-
| cfg | Configuration with settings. |
| id | Vectorloop ID. |
| res_ch | Resource channel used for this vectorloop. |
| app_log_channel | Application log channel used for this vectorloop. |
| query_log_channel | Query log channel used for this vectorloop. |
| metrics | Metrics object vectorloop to use. |
- Returns
- Returns newly created vectorloop object.
◆ 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
-
| arg | Pointer to vectorloop object to run. Argument is of type void* as this function is invoked by pthread_create(). |
- Returns
- NULL pointer returned upon termination.