Skip to content

Commit 124aae3

Browse files
Moon-Ravendkalowsk
authored andcommitted
doc: specify thread safety for each data structure
The documentation of "Kernel/Data Structures" incorrectly states that 'all provided structures are uniformly unsynchronized; access to them is not threadsafe by default'. In reality, some of them are threadsafe and some are not. This might discourage users from using threadsafe data structures where applicable, or mislead users into adding unnecessary locks. This proposal addresses the issue by specifying thread safety for each provided data structure. My assessment of thread safety is based purely on source code analysis; hence an expert verification would be appreciated. Signed-off-by: Vukan Turkulov <vukant@gmail.com>
1 parent 6cc28c7 commit 124aae3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

doc/kernel/data_structures/index.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ behind this design is to allow the collections to be used in contexts
2020
where dynamic allocation is disallowed (i.e. there is no need to
2121
allocate node objects because the memory is provided by the user).
2222

23-
Note also that these libraries are uniformly unsynchronized; access to
23+
Note also that these libraries are generally unsynchronized; access to
2424
them is not threadsafe by default. These are data structures, not
2525
synchronization primitives. The expectation is that any locking
26-
needed will be provided by the user.
26+
needed will be provided by the user. Some of the provided data
27+
structures are thread safe in specific usage scenarios (see
28+
:ref:`spsc_lockfree` and :ref:`mpsc_lockfree`).
2729

2830
.. toctree::
2931
:maxdepth: 1

0 commit comments

Comments
 (0)