]> git.ipfire.org Git - thirdparty/bird.git/commit
Threads: assigning IDs from hmap
authorKaterina Kubecova <katerina.kubecova@nic.cz>
Wed, 18 Dec 2024 13:24:25 +0000 (14:24 +0100)
committerMaria Matejka <mq@ucw.cz>
Wed, 19 Feb 2025 08:42:45 +0000 (09:42 +0100)
commitab6bfbca217c379b5162cae54a26fd55fa0e7b49
tree8f187aed752f2b925ef4d3543d2150c035db0c9f
parent0ff1b5e035cfe8eec1f120188326c065be0ec928
Threads: assigning IDs from hmap

For certain upcoming data structures, we actually need to use thread IDs
as a functional information to index things, not just a logging token.
Thus, we need them to be dense, not just flying around as they were until now.

To achieve this, we assign the IDs from a global hmap when the threads
are started, and properly return them when the threads are finished.
This way, the IDs of stopping threads are expected to be recycled,
whereas until now it wasn't expected to happen.

You may need to take care about this in your log reading apparatus.

Also there is now a maximum thread count hard limit because unlimited
thread count is too crazy to handle. But the limit is still ridiculously
high and nobody is ever expected to hit it anyway.
lib/birdlib.h
lib/io-loop.h
sysdep/unix/config.Y
sysdep/unix/io-loop.c
sysdep/unix/io-loop.h
sysdep/unix/main.c