Re: Usage of Semaphore with a workqueue

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

 



Hi Devesh ...

On Sat, Apr 4, 2009 at 10:35 AM, Devesh Sharma <devesh28@xxxxxxxxx> wrote:
> Hello mulyadi,
>
> Thanks for replying, sorry for late response comments are inline below

It's ok :)

> Do you mean there will not be any difference if I use
> down_interruptible() or down() because
> in workqueue context there is no way to send signal hence both will be
> equivalant?

uhm, you want to send signal from within active work queue? or do you
mean "there is no way for work queue to receive signal"?

>So one must be careful
> while designing semaphore/mutexs+workqueue because it can lead it to
> infinite sleep?

IMO, every resource locking strategy must be designed carefully. I
believe Michael Blizek has explained it better than me.

The thing that you should pay attention is what Michael said: if you
think that sleeping interval might take fairly long time, better
create new workqueue thread (IIRC, it's named "events" kernel thread)
to avoid starving another queued works in the same thread.

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