]> git.ipfire.org Git - thirdparty/bind9.git/commit
Replace netievent lock-free queue with simple locked queue
authorOndřej Surý <ondrej@isc.org>
Tue, 22 Feb 2022 22:40:39 +0000 (23:40 +0100)
committerOndřej Surý <ondrej@isc.org>
Wed, 25 May 2022 14:01:58 +0000 (16:01 +0200)
commit32a3970b13643df0102e2e5312f345a1b3833a67
tree6154e95f7830ccadec01b4a3c49e4887820c21a8
parent5bed841c1c5122c1bc382ab0a941746697eed02b
Replace netievent lock-free queue with simple locked queue

The current implementation of isc_queue uses Michael-Scott lock-free
queue that in turn uses hazard pointers.  It was discovered that the way
we use the isc_queue, such complicated mechanism isn't really needed,
because most of the time, we either execute the work directly when on
nmthread (in case of UDP) or schedule the work from the matching
nmthreads.

Replace the current implementation of the isc_queue with a simple locked
ISC_LIST.  There's a slight improvement - since copying the whole list
is very lightweight - we move the queue into a new list before we start
the processing and locking just for moving the queue and not for every
single item on the list.

NOTE: There's a room for future improvements - since we don't guarantee
the order in which the netievents are processed, we could have two lists
- one unlocked that would be used when scheduling the work from the
matching thread and one locked that would be used from non-matching
thread.

(cherry picked from commit 6bd025942c4aeef42ef06f380a70c70acf490b1d)
17 files changed:
bin/named/main.c
lib/isc/Makefile.in
lib/isc/hp.c [deleted file]
lib/isc/include/isc/Makefile.in
lib/isc/include/isc/hp.h [deleted file]
lib/isc/include/isc/list.h
lib/isc/include/isc/queue.h [deleted file]
lib/isc/include/isc/types.h
lib/isc/managers.c
lib/isc/netmgr/netmgr-int.h
lib/isc/netmgr/netmgr.c
lib/isc/queue.c [deleted file]
lib/isc/task.c
lib/isc/tests/netmgr_test.c
lib/isc/win32/libisc.def.in
lib/isc/win32/libisc.vcxproj.filters.in
lib/isc/win32/libisc.vcxproj.in