diff options
author | Maria Matejka <mq@ucw.cz> | 2022-06-24 19:53:34 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-07-18 13:28:35 +0200 |
commit | e91754f5b9ef68d52f5ff3abcd24661034a0feed (patch) | |
tree | 390d7d4fcdbaeb726fe1c74b192a0a5971ea93e5 /lib/io-loop.h | |
parent | 08c84846089a131a0e7e9e0185b6c6ccb4ed4e2d (diff) |
Event lists rewritten to a single linked list
In multithreaded environment, we need to pass messages between workers.
This is done by queuing events to their respective queues. The
double-linked list is not really useful for that as it needs locking
everywhere.
This commit rewrites the event subsystem to use a single-linked list
where events are enqueued by a single atomic instruction and the queue
is processed after atomically moving the whole queue aside.
Diffstat (limited to 'lib/io-loop.h')
-rw-r--r-- | lib/io-loop.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/io-loop.h b/lib/io-loop.h index 25f1b2a3..dec7d040 100644 --- a/lib/io-loop.h +++ b/lib/io-loop.h @@ -14,12 +14,12 @@ #include "lib/event.h" #include "lib/socket.h" +extern struct birdloop main_birdloop; + void sk_start(sock *s); void sk_stop(sock *s); void sk_reloop(sock *s, struct birdloop *loop); -extern struct birdloop main_birdloop; - /* Start a new birdloop owned by given pool and domain */ struct birdloop *birdloop_new(pool *p, uint order, const char *name); |