Sleeping in workqueues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello people,

I have a question regarding workqueues. I know it's possible to sleep in 
workqueue routines. Does that mean I can use:

1. "set_current_state(TASK_INTERRUPTIBLE);" get the the task with 
"current" and pass it to a other task and then call "schedule();" in a 
workqueue routine and at a different place (perhaps another workqueue 
routine) use wake_up_process(task)" ?

2. initialize completions in a workqueue routine and call complete() in 
a different workqueue routine?

I tried it in a simple example setup and both worked. I just want to 
make sure that was not just by accident. As I understand it a work item 
is executed on a worker, which is a unique process, but I also know that 
there are exceptions, e.g. I can not copy to or from user space in a 
workqueue routine. Also I don't know if a worker "sticks" with the 
current work item until it is completed or can execute multiple work 
items at the "same" time.

3. In case completions and schedule()/wakeup() work, I would also like 
to know, which has the better performance.

Thanks a lot already!

Tobias


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux