Re: Taking semaphores

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

 



On Wed, 22 Jun 2005, Vishwas Manral wrote:

> I have Googled and gone through a lot of links and as well as browsed
> through the Linux code but could not figure this one out. I wanted to
> know if we could take semaphores in timer routine - bottom-half context
> (I guess not). What mechanism (softirq, tasklets, etc) can be used if we
> want to use semaphores? Any links would be of great help.

The only thing you can use to synchronize softirqs and tasklets are 
enabling and disabling processing the bottom halves on the current 
processor completely (local_bih_disable() and local_bh_enable()).

However, you can use conventional locking mechanisms when you are using 
workqueues, as they are run in process context and therefore they can be 
safely rescheduled.

-- 
JiKos.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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