Functions and data structures for worker threads.
More...
#include <freeradius-devel/io/base.h>
#include <freeradius-devel/server/command.h>
#include <freeradius-devel/util/event.h>
#include <freeradius-devel/util/heap.h>
#include <freeradius-devel/util/log.h>
#include <freeradius-devel/util/talloc.h>
#include <pthread.h>
#include <freeradius-devel/server/module.h>
Go to the source code of this file.
|
void | fr_worker (fr_worker_t *worker) |
| The main loop and entry point of the stand-alone worker thread. More...
|
|
fr_channel_t * | fr_worker_channel_create (fr_worker_t *worker, TALLOC_CTX *ctx, fr_control_t *master) |
| Create a channel to the worker. More...
|
|
fr_worker_t * | fr_worker_create (TALLOC_CTX *ctx, fr_event_list_t *el, char const *name, fr_log_t const *logger, fr_log_lvl_t lvl, fr_worker_config_t *config)) |
| Create a worker. More...
|
|
void | fr_worker_debug (fr_worker_t *worker, FILE *fp) |
| Print debug information about the worker structure. More...
|
|
void | fr_worker_destroy (fr_worker_t *worker) |
| Destroy a worker. More...
|
|
int | fr_worker_listen_cancel (fr_worker_t *worker, fr_listen_t const *li) |
|
void | fr_worker_post_event (fr_event_list_t *el, fr_time_t now, void *uctx) |
|
int | fr_worker_pre_event (fr_time_t now, fr_time_delta_t wake, void *uctx) |
|
int | fr_worker_stats (fr_worker_t const *worker, int num, uint64_t *stats) |
|
int | fr_worker_subrequest_add (request_t *request) |
|
Functions and data structures for worker threads.
- Id
- fb138f84a4068ba2ddc45f1acbf97afa8d06bf2d
- Copyright
- 2016 Alan DeKok (aland.nosp@m.@fre.nosp@m.eradi.nosp@m.us.o.nosp@m.rg)
Definition in file worker.h.
◆ fr_worker_config_t
struct fr_worker_config_t |
Definition at line 58 of file worker.h.
Data Fields |
int |
max_channels |
maximum number of channels |
fr_time_delta_t |
max_request_time |
maximum time a request can be processed |
int |
max_requests |
max requests this worker will handle |
int |
message_set_size |
default start number of messages |
int |
ring_buffer_size |
default start size for the ring buffers |
size_t |
talloc_pool_size |
for each request |
◆ fr_worker_t
A data structure to track the worker.
Once spawned, workers exist until they choose to exit.
Definition at line 1 of file worker.h.
◆ fr_worker()
◆ fr_worker_channel_create()
Create a channel to the worker.
Called by the master (i.e. network) thread when it needs to create a new channel to a particuler worker.
- Parameters
-
[in] | worker | the worker |
[in] | master | the control plane of the master |
[in] | ctx | the context in which the channel will be created |
Definition at line 1605 of file worker.c.
◆ fr_worker_create()
Create a worker.
- Parameters
-
[in] | ctx | the talloc context |
[in] | name | the name of this worker |
[in] | el | the event list |
[in] | logger | the destination for all logging messages |
[in] | lvl | log level |
[in] | config | various configuration parameters |
- Returns
- NULL on error
- fr_worker_t on success
Definition at line 1356 of file worker.c.
◆ fr_worker_debug()
void fr_worker_debug |
( |
fr_worker_t * |
worker, |
|
|
FILE * |
fp |
|
) |
| |
Print debug information about the worker structure.
- Parameters
-
[in] | worker | the worker |
[in] | fp | the file where the debug output is printed. |
Definition at line 1580 of file worker.c.
◆ fr_worker_destroy()
Destroy a worker.
The input channels are signaled, and local messages are cleaned up.
This should be called to EXPLICITLY destroy a worker, when some fatal error has occurred on the worker side, and we need to destroy it.
We signal all pending requests in the backlog to stop, and tell the network side that it should not send us any more requests.
- Parameters
-
[in] | worker | the worker to destroy. |
Definition at line 1012 of file worker.c.
◆ fr_worker_listen_cancel()
◆ fr_worker_post_event()
◆ fr_worker_pre_event()
◆ fr_worker_stats()
int fr_worker_stats |
( |
fr_worker_t const * |
worker, |
|
|
int |
num, |
|
|
uint64_t * |
stats |
|
) |
| |
◆ fr_worker_subrequest_add()
int fr_worker_subrequest_add |
( |
request_t * |
request | ) |
|
◆ cmd_worker_table