From 44347114329545f6b53a621e09a596c53884413a Mon Sep 17 00:00:00 2001 From: Mica White Date: Fri, 8 Mar 2024 12:27:47 -0500 Subject: Notes on standard library --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 18c07c0..9888404 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,8 @@ Are the ergonomics really correct here? This is completely untreaded territory. There might be some promise in trying to prevent circular wait. There could be a special type that only allows the locking mutexes in a specific order. This would still require a thread key so that nobody tries to unlock multiple lock sequences at the same time. But this could improve performance, since we wouldn't need to worry about making sure the lock operations are atomic. +It would be nice to try to get this working without the standard library. There are a few problems with this though. For instance, this crate uses `thread_local` to allow other threads to have their own keys. Also, the only practical type of mutex that would work is a spinlock. Although, more could be implemented using the `RawMutex` trait. + Currently, the mutex is implemented using a spinlock. We need to not do that. We could use parking lot, or mutexes from the operating system. A more fair system for getting sets locks would help, but I have no clue what that looks like. -- cgit v1.2.3