- Learning Concurrency in Kotlin
- Miguel Angel Castiblanco Torres
- 112字
- 2021-08-05 10:46:42
Single-core execution
If this is executed in a single core, that core will then interleave between the three threads, each time filtering some of the words before switching to the next one. This interleaving process is called context switching.
Context switching adds overhead to the overall process, because it requires saving the state of the current thread and then loading the state of the next one. This overhead makes it likely that this multi-threaded implementation of isPalindrome() will take longer in a single-core machine when compared to the sequential implementation seen before. This happens because the sequential implementation will have one core do all the work but will avoid the context switch.
推薦閱讀
- Advanced Quantitative Finance with C++
- Drupal 8 Blueprints
- 潮流:UI設計必修課
- 造個小程序:與微信一起干件正經事兒
- Python數據分析基礎
- WSO2 Developer’s Guide
- Modern JavaScript Applications
- 微信小程序入門指南
- Visual FoxPro 6.0程序設計
- Python Digital Forensics Cookbook
- Python全棧開發:基礎入門
- 計算語言學導論
- Java 11 and 12:New Features
- 從零開始學Unity游戲開發:場景+角色+腳本+交互+體驗+效果+發布
- Mastering ASP.NET Web API