-
Notifications
You must be signed in to change notification settings - Fork 358
Closed
Labels
goPull requests that update go codePull requests that update go code
Description
Feature Request
No response
Is your feature request related to a problem? Please describe
The current Fory instance is not thread-safe, requiring users to:
- Manually manage Fory instances per goroutine
- Implement their own pooling for performance
- Risk data races if sharing instances
Describe the solution you'd like
Create a new fory/threadsafe package that:
- Wraps Fory instances using
sync.Poolfor zero-contention concurrency - Provides the same API surface as the main package
- Automatically manages instance lifecycle (acquire/release)
- Includes both generic and non-generic APIs
Benefits
- Safe concurrent use out of the box
- Efficient pooling with automatic cleanup
- No performance overhead for single-threaded use (still use main package)
- Easy migration path for concurrent applications
Describe alternatives you've considered
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
goPull requests that update go codePull requests that update go code