You are viewing a single comment's thread.

view the rest of the comments →

0
1

[–] lmkevin [S] 0 points 1 point (+1|-0) ago 

Kernels have linked lists? I certainly was not aware of this... where do they use them?

0
2

[–] Antikaon 0 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.

0
0

[–] 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/