From d4be32397016b528aaa92f36543bd4237f7626cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Fri, 25 Nov 2022 15:11:51 +0100 Subject: [PATCH] Add a section on hermit-sync --- content/this-month/2022-11/index.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/content/this-month/2022-11/index.md b/content/this-month/2022-11/index.md index f4fb3623..a7ae08af 100644 --- a/content/this-month/2022-11/index.md +++ b/content/this-month/2022-11/index.md @@ -113,6 +113,29 @@ The initial nightlies containing the prebuilt UEFI targets revealed some issues Finally, we [changed the C compiler for the UEFI targets from gcc to clang](https://github.com/rust-lang/rust/pull/104622), which resolved some linker problems. As of the 2022-11-22 nightly, the three UEFI targets should be fully usable, which means you no longer need to use the unstable `-Zbuild-std` feature. +### [`hermitcore/hermit-sync`](https://github.com/hermitcore/hermit-sync) +(Section written by [@mkroening](https://github.com/mkroening)) + +While working on the [`libhermit-rs`] kernel, I moved the synchronization primitives targeted at kernel development into a separate crate: [`hermit-sync`]. +Whilst I was there, I also enhanced the code and made it independent from libhermit, so the code can now be used in other projects as well; at least x86_64 and aarch64 ones for the moment. + +The crate contains the following features: + +* a function for running a closure without interrupts +* a simple spinlock with exponential backoff +* a fair ticket lock with exponential backoff +* `OnceCell` and `Lazy` based on [`generic_once_cell`] (another recent project of mine) + +All of these primitives are available with and without interrupt safety. +See the [API docs] for more details. + +Any feedback is very welcome of course. + +[`libhermit-rs`]: https://github.com/hermitcore/libhermit-rs +[`hermit-sync`]: https://github.com/hermitcore/hermit-sync +[`generic_once_cell`]: https://github.com/mkroening/generic_once_cell +[API docs]: https://docs.rs/hermit-sync + ## Other News