差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

Both sides previous revision 前次修改
下次修改
前次修改
java:java:java8:concurrent:blockingoperationwithcompletablefuture [2019/01/12 23:27]
tony [Reference]
java:java:java8:concurrent:blockingoperationwithcompletablefuture [2023/06/25 09:48] (目前版本)
行 1: 行 1:
-====== Blocking ​Operation ​of CompletableFuture ======+{{tag>​java concurrency}} 
 +====== ​Improve ​Blocking ​Operations ​of CompletableFuture ======
 ===== Introduction ===== ===== Introduction =====
 這陣子在研究CompletableFuture時,剛好看到一篇Oracle關於CompletableFuture如何使用才能有好效能的投影片。我在這裡做了些整理,分享給大家;如果有理解有問題或不足的地方,希望大家可以幫忙更正或補充。本篇圖片都來自於Reference中的投影片。本篇說到五個重點,前四點我會分別說明;第五點如字面上所說,ThreadPool本來就要根據需求而去使用,這裡我不特別探討。 這陣子在研究CompletableFuture時,剛好看到一篇Oracle關於CompletableFuture如何使用才能有好效能的投影片。我在這裡做了些整理,分享給大家;如果有理解有問題或不足的地方,希望大家可以幫忙更正或補充。本篇圖片都來自於Reference中的投影片。本篇說到五個重點,前四點我會分別說明;第五點如字面上所說,ThreadPool本來就要根據需求而去使用,這裡我不特別探討。
-  * Avoid transition task from one thread to another. It costs.  +  * Avoid transition task from one thread to another. It costs. ​[[.blockingoperationwithcompletablefuture:​avoid_transition_task|link]] 
-  * Avoid blocking inside CompletableFuture chains. It costs. [[.blockingoperationwithcompletablefuture:​p2|link]] +  * Avoid blocking inside CompletableFuture chains. It costs. [[.blockingoperationwithcompletablefuture:​blocking_inside_cf|link]] 
-  * Carefully avoid transition task from one thread to another. It costs.  +  * Carefully avoid transition task from one thread to another. It costs. ​[[.blockingoperationwithcompletablefuture:​carefully_avoid_transition_task_of_callback|link]] 
-  * It may be useful to build chain of actions before execution.+  * It may be useful to build chain of actions before execution. ​[[.blockingoperationwithcompletablefuture:​build_chain_before_execution|link]]
   * Different ThreadPools show different performance.   * Different ThreadPools show different performance.
 ===== Reference ===== ===== Reference =====
-  * [[https://​qconsf.com/​sf2017/​system/​files/​presentation-slides/​cf.pdf|Asynchronous API with CompletableFuture - Performance Tips and Tricks]]  +  * [[https://​qconsf.com/​sf2017/​system/​files/​presentation-slides/​cf.pdf|Asynchronous API with CompletableFuture - Performance Tips and Tricks]] ​PDF 
-  * [[https://​www.youtube.com/​watch?​v=lyJBtg6Dgwc|YouTube: ​Asynchronous API with CompletableFuture - Performance Tips and Tricks]] +  * [[https://​www.youtube.com/​watch?​v=lyJBtg6Dgwc|Asynchronous API with CompletableFuture - Performance Tips and Tricks]] ​YouTube
  
 +====== ​ ======
 +----
 +\\
 +~~DISQUS~~