From 643c285c20abab5dadaa5c1929d978b725911b5d Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 26 Mar 2022 19:02:17 +0100 Subject: lib: Move timerwheel processing to its own thread This is the first step moving away from scheduling the FRCT and flow monitoring functions as part of the IPC calls (flow_read / flow_write / fevent) and towards the more scalable (and far less complicated) implementation to take care of these functions in separate threads. If a process creates the first flow that requires FRCT, it will spin up a thread to process events on the timerwheel (retransmissions and delayed ACKs). This single thread lives until the last flow with FRCT is deallocated. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/timerwheel.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/lib/timerwheel.c') diff --git a/src/lib/timerwheel.c b/src/lib/timerwheel.c index c3be08e0..cfdf2c9f 100644 --- a/src/lib/timerwheel.c +++ b/src/lib/timerwheel.c @@ -62,8 +62,6 @@ struct { size_t prv_rxm[RXMQ_LVLS]; /* Last processed rxm slots. */ size_t prv_ack; /* Last processed ack slot. */ pthread_mutex_t lock; - - bool in_use; } rw; static void timerwheel_fini(void) @@ -141,9 +139,6 @@ static void timerwheel_move(void) size_t i; size_t j; - if (!__sync_bool_compare_and_swap(&rw.in_use, true, true)) - return; - pthread_mutex_lock(&rw.lock); pthread_cleanup_push(__cleanup_mutex_unlock, &rw.lock); @@ -383,8 +378,6 @@ static int timerwheel_rxm(struct frcti * frcti, #endif pthread_mutex_unlock(&rw.lock); - __sync_bool_compare_and_swap(&rw.in_use, false, true); - return 0; } @@ -426,7 +419,5 @@ static int timerwheel_ack(int fd, pthread_mutex_unlock(&rw.lock); - __sync_bool_compare_and_swap(&rw.in_use, false, true); - return 0; } -- cgit v1.2.3