Re: workqueues and serialization

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

 



Hi Pradeep...

I meant you can do some work which can sleep without any
worries.Apologies for not being clear.

Ok got it now. In that case, then yes it is safe..


But since work events can be scheduled and can be put to sleep as and
when kernel feels like putting them, why can't then a work event sleep
after intialising the delayed work in work_handler?

I hope I get this part correctly. When you initialize the work even
using INIT_DELAYED_WORK() or such, it means you just fill the related
work event structure, but the event itself isn't scheduled yet. Once
you call schedule_work(), then it is scheduled to run on certain CPU.

Please note that
interrupts are very much enabled so our work can be put to sleep
waiting on the workqueue.
So this means there can more than one work events for the same wanting
to run same work handler on the workqueue.Which will run first we have
no way to know, untill we serialize them though using a semaphore i
guess.

OK let me elaborate. Are you talking about one handler function being
submitted to two different queue? If so, then yes.. it could be one of
them running first followed by the other.

regards,

Mulyadi

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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