Linux work queues are meant to be kernel level threads with process context. I was trying to use it as an alternative to kthread which has no specific process context. But h
It seems like solved, and you have been very helpful to me in order to understand how to use the Work Queues. I give you some code of a simple example in my github, hoping it will be helpful to anyone:
https://github.com/m0r3n/kernel_modules/blob/master/workQueue.c
You can compile with the following Makefile:
KVERSION = $(shell uname -r)
obj-m = workQueue.o
all:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
Insert the module by:
# sync; insmod workQueue.ko; sync
And see the logs:
# tailf /var/log/kern.log
EDIT: I just added the delayed version:
https://github.com/m0r3n/kernel_modules/blob/master/workQueueDelayed.c