You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the migration to Strict Concurrency, PR #41 introduced RWLock and RecursiveRWLock primitives based on the POSIX threads library. This implementation might benefit the whole Spezi ecosystem.
Solution
Move those synchronization data structures to the SpeziFoundation package. These locks would join the AsyncSemaphore as reusable synchronization primitives.
Additional context
We might need to invest some design thinking on which interfaces to expose. We currently only expose async/wait safe withReadLock and withWriteLock methods. Do we want to expose plain lock/unlock methods that you need to balance yourself (see AsyncSemaphore how it is sometimes necessary). Those should then be annotated as not usable from async (see NSLock interface).
Code of Conduct
I agree to follow this project's Code of Conduct and Contributing Guidelines
The text was updated successfully, but these errors were encountered:
# Introduce RWLock, ManagedAsynchronousAccess and DataDescriptor
## ♻️ Current situation & Problem
This PR adds the `RWLock`, `RecursiveRWLock` and
`ManagedAsynchronousAccess` infrastructure that was previously
introduced in SpeziBluetooth (see
StanfordSpezi/SpeziBluetooth#45 and
StanfordSpezi/SpeziBluetooth#47).
This changes require the Swift 6 toolchain. Therefore, we increase the
required swift tools version to 6.0.
This PR introduces the final changes for the SpeziFoundation 2.0 release
(assuming #16 is merged beforehand).
## ⚙️ Release Notes
* Added `RWLock` and `RecursiveRWLock`
* Added `ManagedAsynchronousAccess`
* Only require `sending` closure with `withTimeout` instead of a
`@Sendable` one.
* Add new `DataDescriptor` type.
## 📚 Documentation
Updated the documentation catalog, adding a new "Concurrency" topics
section.
## ✅ Testing
Added unit test for the new components.
## 📝 Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
Problem
With the migration to Strict Concurrency, PR #41 introduced
RWLock
andRecursiveRWLock
primitives based on the POSIX threads library. This implementation might benefit the whole Spezi ecosystem.Solution
Move those synchronization data structures to the SpeziFoundation package. These locks would join the
AsyncSemaphore
as reusable synchronization primitives.Additional context
We might need to invest some design thinking on which interfaces to expose. We currently only expose async/wait safe
withReadLock
andwithWriteLock
methods. Do we want to expose plainlock
/unlock
methods that you need to balance yourself (see AsyncSemaphore how it is sometimes necessary). Those should then be annotated as not usable from async (see NSLock interface).Code of Conduct
The text was updated successfully, but these errors were encountered: