Do read-write semaphores prefer writers over readers?

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

 



Hi,

Why does LDDv3 say that in Read-Write Semaphore, writers are preferred
over readers? Aren't r-w semaphores implemented in First Come, First
Serve basis?

LINK: http://lwn.net/images/pdf/LDD3/ch05.pdf

When they say, writers are preferred over readers - do they mean that,
if for example, a writer is currently holding the semaphore and in the
queue associated with the semaphore, we have 2 readers who've done a
down_read() and then if a writer were to come in with a down_write(),
does the writer get the semaphore over the 2 readers before her?

I would assume the semaphore is obtained by requesters in read-write order.

Thanks,

Hareesh

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