From 889c528e881a612aa7a941c8b5a8aa932a4c0c80 Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Wed, 30 Mar 2022 16:51:08 +0100 Subject: [PATCH] more in the data structure survey --- Data-structure-survey.md | 46 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/Data-structure-survey.md b/Data-structure-survey.md index 16780de..7752cb9 100644 --- a/Data-structure-survey.md +++ b/Data-structure-survey.md @@ -55,6 +55,10 @@ Fixed-size array stack * `isc/netmgr/netmgr` +## notes + +Locked. + # `isc/heap` @@ -68,7 +72,7 @@ Priority queue ## notes -No locking / single-threaded. +Single-threaded. # `isc/ht` @@ -84,12 +88,26 @@ Hash table ## notes -No locking / single-threaded. +Single-threaded. Uses chaining, so it is heavy on indirection and heavy on allocation. Modern hash tables use open addressing. +# `isc/pool` + +A mechanism for sharing a small pool of fungible objects among a large +number of objects that depend on them. + +## used by + + * `dns/zone` for sharing memory contexts + +## notes + +Single-threaded. + + # `isc/radix` Radix tree for IP address prefix matching @@ -101,6 +119,8 @@ Radix tree for IP address prefix matching ## notes +Single-threaded. + Slightly unusual because it is first-match rather than best-match. Tests one bit at a time so there's an opportunity to improve with @@ -108,3 +128,25 @@ Tests one bit at a time so there's an opportunity to improve with The nodes appear to be larger than necessary; is this a problem? How big do ACLs get? + +Uses reserved identifiers for static functions, which is undefined +behaviour. + + +# `isc/taskpool` + +Like `isc/pool`, but specialized for tasks + +## used by + + * `dns/zone` for sharing tasks + +## notes + +Single-threaded. + +Should probably be replaced by the more generic `isc/pool` (it looks +like that was the plan when `isc/pool` was added). + +There appears to be a bug in `isc_taskpool_expand()` when it fails to +create a new task: the existing taskpool will be left empty.