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

HTTPCLIENT-2290 - Refactor HttpClient synchronized sections for virtual threads #476

Merged
merged 1 commit into from
Aug 27, 2023

Conversation

arturobernalg
Copy link
Member

  • Replaced synchronized blocks with ReentrantLock in LeaseRequest to better support virtual threads introduced in JDK 21.
  • Ensured each LeaseRequest instance has its own unique lock for maintaining original synchronization semantics.
  • Addressed potential performance and deadlock issues with virtual threads by using explicit lock primitives from java.util.concurrent.locks.

@arturobernalg arturobernalg changed the title Refactor HttpClient synchronized sections for virtual threads HTTPCLIENT-2290 - Refactor HttpClient synchronized sections for virtual threads Aug 19, 2023
- Replaced `synchronized` blocks with `ReentrantLock` in `LeaseRequest` to better support virtual threads introduced in JDK 21.
- Ensured each `LeaseRequest` instance has its own unique lock for maintaining original synchronization semantics.
- Addressed potential performance and deadlock issues with virtual threads by using explicit lock primitives from `java.util.concurrent.locks`.
Copy link
Member

@ok2c ok2c left a comment

Choose a reason for hiding this comment

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

@arturobernalg Looks good to me.

@arturobernalg arturobernalg merged commit 5eea636 into apache:5.4.x Aug 27, 2023
7 checks passed
ok2c pushed a commit that referenced this pull request Dec 13, 2023
- Replaced `synchronized` blocks with `ReentrantLock` in `LeaseRequest` to better support virtual threads introduced in JDK 21.
- Ensured each `LeaseRequest` instance has its own unique lock for maintaining original synchronization semantics.
- Addressed potential performance and deadlock issues with virtual threads by using explicit lock primitives from `java.util.concurrent.locks`.
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