Skip to content

Conversation

@Lukasa
Copy link
Contributor

@Lukasa Lukasa commented Jan 23, 2025

Motivation

Next on my journey of discovery is NIOThread and NIOThreadPool. These are basically fine, but they need some Sendability annotations and a bit of a cleanup.

Modifications

Add some Sendability
Clean up some shutdown logic to avoid semaphores.

Result

Another step forward to a strict-concurrency safe world.

Motivation

Next on my journey of discovery is NIOThread and NIOThreadPool.
These are basically fine, but they need some Sendability annotations
and a bit of a cleanup.

Modifications

Add some Sendability
Clean up some shutdown logic to avoid semaphores.

Result

Another step forward to a strict-concurrency safe world.
@Lukasa Lukasa added the 🆕 semver/minor Adds new public API. label Jan 23, 2025

typealias ThreadOpsSystem = ThreadOpsPosix

struct PthreadWrapper: @unchecked Sendable {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can't we use our existing UnsafeTransfer for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but in this case I wanted a special-case wrapper that we can see, and aim to remove when it's no longer needed.

@Lukasa
Copy link
Contributor Author

Lukasa commented Jan 23, 2025

The API breakages are expected.

@Lukasa Lukasa merged commit e40cbce into apple:main Jan 23, 2025
32 of 35 checks passed
@Lukasa Lukasa deleted the cb-nio-thread branch January 23, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants