Archived [rant] Somethings you'll learn in college but should NEVER use in the real world (programming)
submitted ago by lmkevin
Posted by: lmkevin
Posting time: 3.9 years ago on
Last edit time: never edited.
Archived on: 4/24/2017 10:00:00 AM
Views: 631
SCP: 7
9 upvotes, 2 downvotes (82% upvoted it)
Archived [rant] Somethings you'll learn in college but should NEVER use in the real world (programming)
submitted ago by lmkevin
view the rest of the comments →
[–] lmkevin [S] 0 points 1 point 1 point (+1|-0) ago
Kernels have linked lists? I certainly was not aware of this... where do they use them?
[–] Antikaon 0 points 2 points 2 points (+2|-0) ago (edited ago)
Check these out:
Kernel Newbies discussion of the Linux kernel's linked list API: https://kernelnewbies.org/FAQ/LinkedLists
From the Linux kernel 4.9 src (Linux/include/linux/list.h) http://lxr.free-electrons.com/source/include/linux/list.h
Linked lists are used in various places in the kernel and in device drivers. They're fast and efficient.
[–] TeranNotTerran ago
Process tables, or whatever you want to call them. Although it's a doubly linked list, child to parent and parent to child(ren)?
At least on FreeBSD. This may be the older version of the book, but the newer one is quite the read. I haven't read the older copy.
https://books.google.com/books?id=KfCuBAAAQBAJ&pg=PA803&lpg=PA803&dq=freebsd+process+table+linked+list&source=bl&ots=u9z0ovNf07&sig=6C1XE-7GXkvK6ZCq4RPwnpRj__o&hl=en&sa=X&ved=0ahUKEwj1guSYgNvRAhXn24MKHdvEDXUQ6AEIGjAA#v=onepage&q=freebsd%20process%20table%20linked%20list&f=false
Looks like they would use queue() as a helper, though: https://forums.freebsd.org/threads/38827/