Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> xnu supports priority inheritance through "turnstiles"

Do you have any information on how long this "turnstiles" feature has been available? [1] I was aware that the userspace pthread libraries implement but ignore PTHREAD_PRIO_INHERIT, but wasn't aware that the underlying implementation gave priority inheritance semantics.

Update: Looks like the "turnstiles" feature may have its origins in Solaris. [2]

[1] This link would suggest as of Mac OS 10.14: http://newosxbook.com/articles/12-10.14.html

[2] http://sunsite.uakom.sk/sunworldonline/swol-08-1999/swol-08-...



Yeah, looks like 10.14 and iOS 12. I actually hadn't realized it was so new. Before that, it seems that priority inheritance ("promotion") had long existed for kernel-internal locks [1], but not for anything in userland. It also seems that the behavior of supporting but ignoring PTHREAD_PRIO_INHERIT long predates turnstiles, which is pretty annoying.

As for origins... xnu's implementation appears to be written from scratch, but in terms of inspiration for the design and name, I'm not sure. Aside from Solaris, another possibility is FreeBSD [2] (but note that xnu's turnstiles are in the Mach side of the codebase rather than the BSD side).

[1] https://opensource.apple.com/source/xnu/xnu-1504.15.3/osfmk/...

[2] https://github.com/freebsd/freebsd/commits/master/sys/sys/tu...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: