Coordination thread management.
More...
#include <freeradius-devel/io/control.h>
#include <freeradius-devel/io/message.h>
#include <freeradius-devel/server/cf_util.h>
#include <freeradius-devel/util/dbuff.h>
#include <freeradius-devel/util/semaphore.h>
Go to the source code of this file.
|
| typedef fr_coord_cb_inst_t *(* | fr_coord_cb_inst_create_t) (TALLOC_CTX *ctx, fr_coord_t *coord, fr_event_list_t *el, bool single_thread, void *uctx) |
| |
| typedef struct fr_coord_cb_inst_s | fr_coord_cb_inst_t |
| |
| typedef void(* | fr_coord_cb_t) (fr_coord_t *coord, uint32_t worker_id, fr_dbuff_t *dbuff, fr_time_t now, void *plugin_data, void *uctx) |
| |
| typedef struct fr_coord_reg_s | fr_coord_reg_t |
| |
| typedef struct fr_coord_s | fr_coord_t |
| |
| typedef void(* | fr_coord_worker_cb_t) (fr_coord_worker_t *cw, fr_dbuff_t *dbuff, fr_time_t now, void *uctx) |
| |
| typedef struct fr_coord_worker_s | fr_coord_worker_t |
| |
|
| fr_coord_worker_t * | fr_coord_attach (TALLOC_CTX *ctx, fr_event_list_t *el, fr_coord_reg_t *coord_reg) |
| | Attach a worker to a coordinator.
|
| |
| void | fr_coord_deregister (fr_coord_reg_t *coord_reg) |
| | De-register a coordinator.
|
| |
| int | fr_coord_detach (fr_coord_worker_t *cw, bool exiting) |
| | Signal a coordinator that a worker wants to detach.
|
| |
| int | fr_coord_post_event_insert (fr_event_list_t *el) |
| | Insert instance specific post-event callbacks.
|
| |
| int | fr_coord_pre_event_insert (fr_event_list_t *el) |
| | Insert instance specific pre-event callbacks.
|
| |
| fr_coord_reg_t * | fr_coord_register (TALLOC_CTX *ctx, fr_coord_reg_ctx_t *reg_ctx) |
| | Register a coordinator.
|
| |
| int | fr_coord_start (uint32_t num_workers, fr_sem_t *sem) |
| | Start all registered coordinator threads in multi-threaded mode.
|
| |
| int | fr_coord_to_worker_broadcast (fr_coord_t *coord, uint32_t cb_id, fr_dbuff_t *dbuff) |
| | Broadcast data from a coordinator to all workers.
|
| |
| int | fr_coord_to_worker_send (fr_coord_t *coord, uint32_t worker_id, uint32_t cb_id, fr_dbuff_t *dbuff) |
| | Send generic data from a coordinator to a worker.
|
| |
| int | fr_coords_create (TALLOC_CTX *ctx, fr_event_list_t *el) |
| | Start coordinators in single threaded mode.
|
| |
| void | fr_coords_destroy (void) |
| | Clean up coordinators in single threaded mode.
|
| |
| int | fr_worker_to_coord_send (fr_coord_worker_t *cw, uint32_t cb_id, fr_dbuff_t *dbuff) |
| | Send data from a worker to a coordinator.
|
| |
Coordination thread management.
- Id
- f93afd986e308bf1c181410b61234ea58b8be6ec
- Copyright
- 2026 Network RADIUS SAS (legal.nosp@m.@net.nosp@m.workr.nosp@m.adiu.nosp@m.s.com)
Definition in file coord.h.
◆ fr_coord_cb_reg_t
◆ fr_coord_reg_ctx_t
| struct fr_coord_reg_ctx_t |
Definition at line 59 of file coord.h.
| Data Fields |
|
fr_coord_cb_reg_t * |
coord_cb |
Callbacks for worker -> coordinator messages. |
|
size_t |
coord_send_size |
Initial ring buffer size for coordinator -> worker data. Defaults to 4096 of not set.
|
|
char const * |
name |
Name for this coordinator. |
|
fr_coord_worker_cb_reg_t * |
worker_cb |
Callbacks for coordinator -> worker messages. |
|
size_t |
worker_send_size |
Initial ring buffer size for worker -> coordinator data. Defaults to 4096 if not set.
|
◆ fr_coord_to_worker_ctx_t
| struct fr_coord_to_worker_ctx_t |
◆ fr_coord_worker_cb_reg_t
| struct fr_coord_worker_cb_reg_t |
◆ fr_worker_to_coord_ctx_t
| struct fr_worker_to_coord_ctx_t |
◆ FR_COORD_CALLBACK_TERMINATOR
| #define FR_COORD_CALLBACK_TERMINATOR { .callback = NULL } |
◆ fr_coord_cb_inst_create_t
◆ fr_coord_cb_inst_t
◆ fr_coord_cb_t
◆ fr_coord_reg_t
◆ fr_coord_t
◆ fr_coord_worker_cb_t
◆ fr_coord_worker_t
◆ fr_coord_attach()
Attach a worker to a coordinator.
- Parameters
-
| ctx | To allocate worker structure in |
| el | Event list for control messages |
| coord_reg | Coordinator registration to attach to. |
- Returns
- Worker structure for coordinator use on success
- NULL on failure
Definition at line 628 of file coord.c.
◆ fr_coord_deregister()
De-register a coordinator.
To be called from mod_detach of a module which uses a coordinator
When running in threaded mode, will wait for the coordinator to exit.
- Parameters
-
Definition at line 167 of file coord.c.
◆ fr_coord_detach()
Signal a coordinator that a worker wants to detach.
- Parameters
-
| cw | Worker which is detaching. |
| exiting | Is the server exiting. |
Definition at line 589 of file coord.c.
◆ fr_coord_post_event_insert()
Insert instance specific post-event callbacks.
Definition at line 796 of file coord.c.
◆ fr_coord_pre_event_insert()
Insert instance specific pre-event callbacks.
Definition at line 771 of file coord.c.
◆ fr_coord_register()
Register a coordinator.
To be called from mod_instantiate of a module which uses a coordinator
- Parameters
-
| ctx | to allocate registration under |
| reg_ctx | Registration data |
- Returns
- coordination registration on success
- NULL on failure
Definition at line 135 of file coord.c.
◆ fr_coord_start()
Start all registered coordinator threads in multi-threaded mode.
- Parameters
-
| num_workers | The number of workers which will be attaching |
| sem | Semaphore to use signalling the threads are ready |
- Returns
- 0 on success
- -1 on failure
Definition at line 490 of file coord.c.
◆ fr_coord_to_worker_broadcast()
Broadcast data from a coordinator to all workers.
- Parameters
-
| coord | Coordinator which is sending the data. |
| cb_id | Callback ID for the workers to run. |
| dbuff | Buffer containing data to send. |
- Returns
- 0 on success
- <0 on failure - indicating the number of sends which failed.
Definition at line 724 of file coord.c.
◆ fr_coord_to_worker_send()
Send generic data from a coordinator to a worker.
- Parameters
-
| coord | Coordinator which is sending the data. |
| worker_id | Worker to send data to. |
| cb_id | Callback ID for the worker to run. |
| dbuff | Buffer containing data to send. |
- Returns
- 0 on success
- <0 on failure
Definition at line 691 of file coord.c.
◆ fr_coords_create()
Start coordinators in single threaded mode.
Definition at line 558 of file coord.c.
◆ fr_coords_destroy()
| void fr_coords_destroy |
( |
void |
| ) |
|
Clean up coordinators in single threaded mode.
Definition at line 540 of file coord.c.
◆ fr_worker_to_coord_send()
Send data from a worker to a coordinator.
- Parameters
-
| cw | Worker side of coordinator sending the data. |
| cb_id | Callback ID for the coordinator to run. |
| dbuff | Buffer containing data to send. |
- Returns
- 0 on success
- < 0 on failure
Definition at line 746 of file coord.c.