Re: Memory address alignment and atomic operations.

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

 



Momchil Velikov wrote:

Jon Masters wrote:

Tetsuo Handa wrote:

 9: void add_tail(FOO *next) {
10:   static spinlock_t lock = SPIN_LOCK_UNLOCKED;
11:   FOO *f = &first;
12:   spin_lock(&lock);



You just declared a local spinlock on the stack and then lock and unlock it diligently - who is going to contend with you for that resource?

It is not on the stack.

Sorry, missed the static in my parsing. My bad.

Jon.


-- 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