Skip to content

Commit 9497af4

Browse files
authored
chore: Add new line to the doc (#162)
Motivation: Update the doc, it's missing new line @lihaoyi please add this and rererender the page
1 parent 83a7844 commit 9497af4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/pages/1 - Cask - a Scala HTTP micro-framework.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,13 @@ Cask can support using Virtual Threads to handle the request out of the box, you
473473
4. tweak the underlying carrier threads with `-Djdk.virtualThreadScheduler.parallelism`, `jdk.virtualThreadScheduler.maxPoolSize` and `jdk.unparker.maxPoolSize`.
474474
475475
**Advanced Features**:
476+
476477
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.
477478
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.
478479
3. You can use `jdk.internal.misc.Blocker`'s `begin` and `end` methods to help the `ForkJoinPool` when needed.
479480
480481
**NOTE**:
482+
481483
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.
482484
2. A common deadlock can happen when both a virtual thread and a platform thread try to load the same class, but there is no carrier thread available to execute the virtual thread, which will lead to a deadlock, make sure `jdk.virtualThreadScheduler.maxPoolSize` is large enough to avoid it.
483485
3. Virtual thread does some kind of `rescheduling` which may lead to higher latency when the task is actually cpu bound.

0 commit comments

Comments
 (0)