mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] Simple question regarding read-write locks precedence
@ 2020-03-31 15:05 Koen Vandeputte
  2020-03-31 15:09 ` Rich Felker
  0 siblings, 1 reply; 10+ messages in thread
From: Koen Vandeputte @ 2020-03-31 15:05 UTC (permalink / raw)
  To: musl

Hi All,

I've written a user app which make use of reader-writer locks.

Topology is pretty simple:

- 1 writer

- 4 readers


Writes only occur once in a while.

Readers are heavy users of the lock.


The default behavior in musl is Reader precedence.

In my usecase, it means that a writer never aquires the lock causing 
writer starvation.

Debugging nicely shows that readers also "jump over" the waiting writer 
as there is always at least 1 reader present in the critical section at 
any time.

Going through the source code shows that there is no support for 
specifying lock attributes which give writers precedence over readers.


Is there an update scheduled to add the required attribute types which 
allow writer precedence to avoid starvation?


Thanks,

Koen


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-03-31 20:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 15:05 [musl] Simple question regarding read-write locks precedence Koen Vandeputte
2020-03-31 15:09 ` Rich Felker
2020-03-31 15:21   ` Koen Vandeputte
2020-03-31 15:26     ` Rich Felker
2020-03-31 17:21       ` Markus Wichmann
2020-03-31 17:37         ` Rich Felker
2020-03-31 18:38           ` Markus Wichmann
2020-03-31 19:02             ` Michael Kerrisk (man-pages)
2020-03-31 19:45               ` Markus Wichmann
2020-03-31 20:15                 ` Michael Kerrisk (man-pages)

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).