Hacker News new | ask | show | jobs
by LeFantome 180 days ago
To be fair, one of the main reasons linked lists are used is that more advanced data structures are too hard at the OS level with C.
1 comments

Intrusive linked lists have performance and robustness benefits for kernel programming, chiefly that they don't require any dynamic memory allocation and can play nice with scenarios where not all memory might be "paged in", and the paging system itself needs data structures to track memory statues. Linked lists for this type of use also have consistently low latency, which can matter a lot in some scenarios such as network packet processing. I.e.: loading a struct into L1 cache also loads its member pointers to the next struct, saving an additional step looking it up in some external data structure.