Article 64DDY Al-Qudsi: Implementing truly safe semaphores in rust

Al-Qudsi: Implementing truly safe semaphores in rust

by
corbet
from LWN.net on (#64DDY)
Mahmoud Al-Qudsi providesextensive details on what it takes to implement a safe semaphore typein the Rust language.

The problem is that with n > 1, there's no concept of aprivileged" owning thread and all threads that have obtained" thesemaphore do so equally. Therefore, a rust semaphore can only everprovide read-only (&T) access to an underlying resource,limiting the usefulness of such a semaphore almost to the point ofhaving no utility. As such, the only safe owning" semaphore withread-write access that can exist in the rust world would beSemaphore<()>, or one that actually owns no data and canonly be used for its side effect of limiting concurrency while thesemaphore is owned," so to speak.
External Content
Source RSS or Atom Feed
Feed Location http://lwn.net/headlines/rss
Feed Title LWN.net
Feed Link https://lwn.net/
Reply 0 comments