diff options
author | Dave Barach <dave@barachs.net> | 2019-06-03 19:48:22 -0400 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-06-04 13:04:42 +0000 |
commit | c602b384ac022f70690a3a7c711149f7cb63ad12 (patch) | |
tree | cad51d5702502d35c714b3a003d000ffe7aae4db /src/vlib/threads.h | |
parent | c424de75e561b2197d29812b3900db58a06096d7 (diff) |
sort worker-thread init functions in advance
Otherwise, all N worker threads try to sort the list at the same time:
a good way to have a bad day.
This approach performs *far* better than maintaing order by adding a
spin-lock. By direct measurement w/ elog + g2: 11 threads execute the
per-thread init function list in 22us, vs. 50ms with a CLIB_PAUSE()
enabled spin-lock.
Change-Id: I1745f2a213c0561260139a60114dcb981e0c64e5
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlib/threads.h')
-rw-r--r-- | src/vlib/threads.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vlib/threads.h b/src/vlib/threads.h index 5a295e03319..fc34074127f 100644 --- a/src/vlib/threads.h +++ b/src/vlib/threads.h @@ -206,6 +206,7 @@ u32 vlib_frame_queue_main_init (u32 node_index, u32 frame_queue_nelts); void vlib_worker_thread_barrier_sync_int (vlib_main_t * vm, const char *func_name); void vlib_worker_thread_barrier_release (vlib_main_t * vm); +void vlib_worker_thread_initial_barrier_sync_and_release (vlib_main_t * vm); void vlib_worker_thread_node_refork (void); static_always_inline uword |