1. The list

  2. Queue head/tail pointer length, type (length/datatype)

    Head out (usually pointing to empty)

    Align some basic concepts, like waiting in line for a ticket at a train station: The first person in line gets a ticket (FIFO)

    Queues that allow queue-jumping are called priority queues

    Queue false overflow :(there is unfreed space in the queue, the solution is to loop the queue. Loop the queue tail until it points to the beginning, effectively using space in the queue

Whether a queue is empty or not is a logical definition

  1. Application Scenarios of queue technology Scenario 1: HYPERthreading technology of the CPU The instruction transmitting tube connected to the dual-core core can be regarded as the instruction queue virtual quad-core: how to add virtual instruction queues to each core

    Scenario 2: Task queues in a thread pool For example, if a person is doing multiple tasks in a process, the thread pool can be used if the thread is frequently applied or destroyed. Create a task queue as a task buffer. A new task is put into the task queue, and the thread retrieves the task from the task queue

Functional programming/generic programming