spinlock & volatile

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

 



Hi,
assume we have this:

struct {
	spinlock_t lock;
	int flag;
	/* Some other stuff... */
} v;

v is accessed from different execution contexts including from ISR.
While accessing v the lock will be held.
However, do I have to qualify flag (and the other stuff) volatile
to make sure that the users of v always see the most recent
version of it?
Or does spin_un/lock() imply *memory sync* (some form of
barrier() or whatever)?

/FAU

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