Categorías
Otros

[Linux kernel analysis and application – Chen Lijun] Práctica manual : instancia principal de simultaneidad multitarea

1. Deritage multitarea simultáneamente

In this section we will use an example to see how to use these synchronization mechanisms in Linux to implement complex multitasking.
 Briefly introduce this example:
 1. Share resource-linked list
 2. Three different types of kernel tasks will access the linked list and insert or delete the node.
     2.1 The kernel thread is responsible for adding a new node to the linked list;
     2.2 The internal nuclear timer is responsible for the timing deletion node;
     2.3 System call is responsible for destroying the entire linked list at some point.
 These three kernel tasks are possible to destroy the integrity of kernel data when they execute, so we must perform the linked list.
 Synchronize access protection to ensure data consistency, in such a multi-task concurrently accessible model, we need
 Use the appropriate kernel synchronization mechanism to manage these tasks so that they can be implemented in an orderly manner, we mainly
 Used tools
       signal, 
       Self-rotation lock,
       Work queue,
       Timer.

2. Cola de trabajo

3. Temporizador

.

  POJ1789 (árbol de span mínimo)

Por Programación.Click

Más de 20 años programando en diferentes lenguajes de programación. Apasionado del code clean y el terminar lo que se empieza. ¿Programamos de verdad?

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *