I’ve been searching for information for a common kernel implementation of queues, that is, first-in-first-out data structures. I thought there may be one since it’s likely something that’s common to use, and there’s a standard for linked lists (in the form of the list_head structure). Is there some standard queue implementation I can’t find, or is it perhaps common practice to just use linked lists as queues and hope for the best?
I’ve been searching for information for a common kernel implementation of queues, that is,
Share
You’re right, the Linux kernel typically uses linked lists to implement queues. This makes sense, because linked lists offer the required behavior. See this example from kernel/workqueue.c: