Kernel Threads

The Linux kernel spawns threads which handle background operation. These kernel threads have a PID and also contain a task structure similar to a process. However, the kernel thread does not have a specific address space where they are mapped to. The kernel threads run exclusively in kernel space and take care of asynchronous events […]

Creating a dedicated workqueue

In the previous articles, we created work and we scheduled the work using default worker threads. If a dedicated workqueue is desired specifically to handle specific work for the kernel module that you are developing, a workqueue can be created using “create_workqueue” API. The code block creates a work queue, assigns initialized work and later […]

Workqueue APIs

The below table lists out the different workqueue APIs that are commonly used in the intialization and usage of a workqueue. For a comprehensive list – refer “workqueue.h” in the linux kernel. Workqueue API Description schedule_work Schedule the work to be performed schedule_delayed_work Put work task in global workqueue after delay create_workqueue Creating a new […]

Tasklet APIs

There are a number of APIs that are defined for Tasklet operation in the Linux kernel. The below table provides a list of Tasklet APIs with a brief description of the APIs. For a more comprehensive list – refer /linux/interrupt.h file in the Linux kernel Tasklet API Description tasklet_init Initialize the tasklet. Used in dynamic […]