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

Add support for Virtual Threads #4399

Closed
3 tasks done
fmbenhassine opened this issue Jun 15, 2023 · 1 comment
Closed
3 tasks done

Add support for Virtual Threads #4399

fmbenhassine opened this issue Jun 15, 2023 · 1 comment
Assignees
Labels
in: core status: for-internal-team Issues that are planned to be resolved by the Spring Batch team, and not open for contributions. type: feature
Milestone

Comments

@fmbenhassine
Copy link
Contributor

fmbenhassine commented Jun 15, 2023

Virtual Threads (Project Loom) will be out of preview in JDK 21. This issue is to:

  • Make sure that Spring Batch behaves in the same way with virtual threads as with platform threads
  • Replace synchronized blocks/methods that contain blocking I/O operations with reentrant locks
  • Check what should be updated in the Batch auto-configuration of Spring Boot with regard to virtual threads
@fmbenhassine fmbenhassine added this to the 5.1.0-M1 milestone Jun 15, 2023
fmbenhassine added a commit that referenced this issue Jul 14, 2023
@fmbenhassine fmbenhassine self-assigned this Jul 14, 2023
@fmbenhassine fmbenhassine added the status: for-internal-team Issues that are planned to be resolved by the Spring Batch team, and not open for contributions. label Jul 14, 2023
fmbenhassine added a commit that referenced this issue Jul 15, 2023
This commit replaces synchronized blocks and methods
that are used frequently or that guard blocking I/O
operations with locks. This is required to prevent
virtual threads pinning, as explained in JEP 444 [1].

Note that synchronized blocks and methods that are used
infrequently (like AutomaticJobRegistrar#start/stop) or
that guard in-memory operations were not replaced as this
is not required, see JEP 444 [1].

Resolves to #4399

---
[1]: https://openjdk.org/jeps/444
@fmbenhassine
Copy link
Contributor Author

  • Test suite for virtual threads added in 0516808, tested successfully against JDK 21 EA Build 31 ✅
  • Synchronized blocks/methods replaced with locks in 5bccfed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: for-internal-team Issues that are planned to be resolved by the Spring Batch team, and not open for contributions. type: feature
Projects
None yet
Development

No branches or pull requests

1 participant