Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yup, I believe the kernel pretty much just uses linked lists (at least, all of the running processes are kept as a linked list). But when most of your resources only number in the tens of thousands, if that, a linked list works perfectly well. And I’m not a kernel hacker so I’m sure there are optimizations I’m not aware of.



I know the kernel uses trees for a good number of different things. I'd imagine that processes would be a BST of some time and I remember Linus mentioning RB-Trees. It would definitely make the most sense as RB-Trees have better access and insertion than a sorted linked list.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: