Skip to content

Commit e049105

Browse files
authored
Merge pull request #692 from jborgers/pmd7-fix-dzone-link
fix beware of common pool dzone link in docs
2 parents 9823490 + b4ef7ee commit e049105

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/JavaCodePerformance.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ See: [completablefuture-and-timeout](https://stackoverflow.com/questions/6041931
804804
which is suitable to keep all CPU's busy with in-memory processing.
805805
For I/O, however, this number is typically not suitable because relatively much time is spent waiting for the response and not in CPU.
806806
This likely exhausts the common pool for some time thereby blocking all other use of the common pool.
807-
The common pool must *not* be used for blocking calls, see [Be Aware of ForkJoinPool#commonPool()](https://dzone.com/articles/be-aware-of-forkjoinpoolcommonpo)
807+
The common pool must *not* be used for blocking calls, see [Be Aware of ForkJoinPool#commonPool()](https://dzone.com/articles/be-aware-of-forkjoinpoolcommonpool)
808808
**Solution:** A separate, properly sized, pool of threads (an Executor) should be used for the async calls.
809809
**Rule name:** AvoidCommonPoolForFutureAsync
810810
**Example:**
@@ -832,7 +832,7 @@ public class Foo {
832832
which is suitable to keep all CPU's busy with in-memory processing.
833833
For I/O or other blocking calls, however, this number is typically not suitable because relatively much time is spent waiting for the response and not in CPU.
834834
This likely exhausts the common pool for some time thereby blocking all other use of the common pool.
835-
The common pool must *not* be used for blocking calls, see [Be Aware of ForkJoinPool#commonPool()](https://dzone.com/articles/be-aware-of-forkjoinpoolcommonpo)
835+
The common pool must *not* be used for blocking calls, see [Be Aware of ForkJoinPool#commonPool()](https://dzone.com/articles/be-aware-of-forkjoinpoolcommonpool)
836836
**Solution:** A separate, properly sized, pool of threads (an Executor or ForkJoinPool) should be used for the async calls.
837837
**Rule name:** AvoidCommonPoolForBlockingCalls
838838
**Example:**
@@ -902,7 +902,7 @@ class AxualProducerGood2{
902902
It is designed to distribute much CPU work over the cores.
903903
It is *not* meant for remote calls nor other blocking calls.
904904
In addition, parallelizing has overhead and risks, should only be used for much pure CPU processing.
905-
The common pool must *not* be used for blocking calls, see [Be Aware of ForkJoinPool#commonPool()](https://dzone.com/articles/be-aware-of-forkjoinpoolcommonpo)
905+
The common pool must *not* be used for blocking calls, see [Be Aware of ForkJoinPool#commonPool()](https://dzone.com/articles/be-aware-of-forkjoinpoolcommonpool)
906906
**Solution:** For remote/blocking calls: Use a dedicated thread pool with enough threads to get proper parallelism independent of the number of cores.
907907
For pure CPU processing: use ordinary sequential streaming unless the work takes more than about 0,1 ms in sequential form and proves to be faster with parallelization.
908908
So only for large collections and much processing without having to wait.

0 commit comments

Comments
 (0)