Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #384: change handling of SmileBufferRecycler to be thread-safe #385

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

cowtowncoder
Copy link
Member

Simplify SmileBufferRecycler by using AtomicReference to guard access to buffers. This didn't use to be problematic before async handling (when there was typically 1-to-1 matching between threads and Parser/Generator instances).
However, this changed for both:

  1. Async Smile parser
  2. Non-blocking frameworks where access to input is not handled with BIO (and as a result there's no thread-to-parser/generator binding)

and so there's no guarantee of atomicity for reuse by recycler.

@cowtowncoder
Copy link
Member Author

@simondaudin I think this should fix it; will merge but would appreciate if you could verify on your end. Targeting 2.15 branch for eventual 2.15.3 release (and 2.16.0).

@cowtowncoder cowtowncoder added this to the 2.15.3 milestone Jun 19, 2023
@cowtowncoder cowtowncoder merged commit ce68a2b into 2.15 Jun 19, 2023
3 checks passed
@cowtowncoder cowtowncoder deleted the tatu/384-fix-smile-buffer-recycler branch June 19, 2023 20:25
@simondaudin
Copy link

@cowtowncoder Thank you for the fix, that was fast !
I tested with:

  • The test I has given in the issue -> OK
  • A test I had with some of our application logic -> also OK
    For my point of view, it's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants