Skip to content

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Aug 21, 2024

Motivation:

Swift 6 has a Mutex which we can use in place of LockedValueBox or NIOLockedValueBox in a bunch of places.

Modifications:

  • Use Mutex where possible
  • This causes a number of other changes too as Mutex doesn't allocate: the allocations move to the type holding it instead. This makes sense as the objects which were previously structs didn't have value semantics.

Result:

Fewer uses of our own lock, no uses of NIOs lock

Motivation:

Swift 6 has a `Mutex` which we can use in place of `LockedValueBox` or
`NIOLockedValueBox` in a bunch of places.

Modifications:

- Use `Mutex` where possible
- This causes a number of other changes too as `Mutex` doesn't allocate:
  the allocations move to the type holding it instead. This makes sense
  as the objects which were previously structs didn't have value
  semantics.

Result:

Fewer uses of our own lock, no uses of NIOs lock
@glbrntt glbrntt requested a review from gjcairo August 21, 2024 09:48
@glbrntt glbrntt added the version/v2 Relates to v2 label Aug 21, 2024
@glbrntt glbrntt enabled auto-merge (squash) September 2, 2024 14:27
@glbrntt glbrntt requested a review from gjcairo September 2, 2024 14:27
@glbrntt glbrntt merged commit 493dbef into grpc:main Sep 2, 2024
14 of 16 checks passed
@glbrntt glbrntt deleted the v2/adopt-mutex branch September 2, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version/v2 Relates to v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants