Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
He-Pin committed Jan 21, 2025
1 parent 80fb42c commit cb248de
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/pages/1 - Cask - a Scala HTTP micro-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ Cask can support using Virtual Threads to handle the request out of the box, you
1. You can change the default scheduler of the carrier threads with `cask.internal.Util.createVirtualThreadExecutor` method, but keep in mind, that's not officially supported by JDK for now.
2. You can supply your own `Executor` by override the `handlerExecutor()` method in your `cask.Main` object, which will be called only once when the server starts.
3. You can use `jdk.internal.misc.Blocker`'s `begin` and `end` methods to help the `ForkJoinPool` when needed.
4. You can use `Util.createVirtualThreadScheduler` to create separate `ForkJoinPool` as scheduler for the virtual threads.
**NOTE**:
1. If your code is CPU-bound, you should not use virtual threads, because it will not improve the performance, but will increase the overhead.
Expand Down

0 comments on commit cb248de

Please sign in to comment.