logoalt Hacker News

jcalvinowensyesterday at 1:21 PM2 repliesview on HN

> What I would really like is the ability to change defaults for all mutexes created in the program, and have everyone use the same std mutexes.

Assuming you're building the whole userspace at once with something like yocto... you can just patch pthread to change the default to PTHREAD_PRIO_INHERIT and silently ignore attempts to set it to PTHREAD_PRIO_NONE. It's a little evil though.

> By the way: rwlocks are often a bad idea

+1


Replies

VorpalWayyesterday at 2:30 PM

That is a great terrible idea (I really have to think a bit more on that). Won't help for Rust, since the mutexes there use futex directly, so you would have to patch the standard library itself (and for futex it is more complex than just enabling a flag). Seems plausible that other libraries and language runtimes might do similar things.

show 1 reply
i_am_a_peasantyesterday at 1:31 PM

i think both you guys have the same job as me lol