- 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.
推薦閱讀
- Web程序設計及應用
- Oracle WebLogic Server 12c:First Look
- 跟“龍哥”學C語言編程
- Building a RESTful Web Service with Spring
- Magento 2 Theme Design(Second Edition)
- Learning Salesforce Einstein
- 數據結構案例教程(C/C++版)
- Access 2010數據庫應用技術(第2版)
- 微信小程序全棧開發技術與實戰(微課版)
- MySQL程序員面試筆試寶典
- 工業機器人離線編程
- Web程序設計:ASP.NET(第2版)
- 青少年學Python(第2冊)
- HTML5移動前端開發基礎與實戰(微課版)
- Python物理建模初學者指南(第2版)