mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Decoupling loops from threads to allow fixed thread count
On large configurations, too many threads would spawn with one thread per loop. Therefore, threads may now run multiple loops at once. The thread count is configurable and may be changed during run. All threads are spawned on startup. This change helps with memory bloating. BIRD filters need large temporary memory blocks to store their stack and also memory management keeps its hot page storage per-thread. Known bugs: * Thread autobalancing is not yet implemented. * Low latency loops are executed together with standard loops.
This commit is contained in:
@@ -14,6 +14,7 @@ struct domain_generic;
|
||||
/* Here define the global lock order; first to last. */
|
||||
struct lock_order {
|
||||
struct domain_generic *the_bird;
|
||||
struct domain_generic *control;
|
||||
struct domain_generic *proto;
|
||||
struct domain_generic *service;
|
||||
struct domain_generic *rtable;
|
||||
@@ -34,6 +35,9 @@ struct domain_generic *domain_new(const char *name, uint order);
|
||||
#define DOMAIN_FREE(type, d) domain_free((d).type)
|
||||
void domain_free(struct domain_generic *);
|
||||
|
||||
#define DOMAIN_NAME(type, d) domain_name((d).type)
|
||||
const char *domain_name(struct domain_generic *);
|
||||
|
||||
#define DOMAIN_NULL(type) (DOMAIN(type)) {}
|
||||
|
||||
#define LOCK_DOMAIN(type, d) do_lock(((d).type), &(locking_stack.type))
|
||||
|
Reference in New Issue
Block a user