- Learning Concurrency in Kotlin
- Miguel Angel Castiblanco Torres
- 218字
- 2021-08-05 10:46:44
Flexible
Kotlin offers many different primitives that allow for simple-yet-flexible concurrency. You will find that there are many ways to do concurrent programming in Kotlin. Here is a list of some of the topics we will look at throughout the book:
- Channels: Pipes that can be used to safely send and receive data between coroutines.
- Worker pools: A pool of coroutines that can be used to divide the processing of a set of operations in many threads.
- Actors: A wrapper around a state that uses channels and coroutines as a mechanism to offer the safe modification of a state from many different threads.
- Mutual exclusions (Mutexes): A synchronization mechanism that allows the definition of a critical zone so that only one thread can execute at a time. Any coroutine trying to access the critical zone will be suspended until the previous coroutine leaves.
- Thread confinement: The ability to limit the execution of a coroutine so that it always happens in a specified thread.
- Generators (Iterators and sequences): Data sources that can produce information on demand and be suspended when no new information is required.
All of these are tools that are at your fingertips when writing concurrent code in Kotlin, and their scope and use will help you to make the right choices when implementing concurrent code.
推薦閱讀
- Designing Machine Learning Systems with Python
- PyTorch Artificial Intelligence Fundamentals
- 趣學(xué)Python算法100例
- 單片機(jī)應(yīng)用技術(shù)
- 秒懂設(shè)計(jì)模式
- Spring實(shí)戰(zhàn)(第5版)
- MySQL數(shù)據(jù)庫基礎(chǔ)實(shí)例教程(微課版)
- Getting Started with LLVM Core Libraries
- 區(qū)塊鏈技術(shù)與應(yīng)用
- Clean Code in C#
- Instant Debian:Build a Web Server
- Hands-On Kubernetes on Windows
- Oracle數(shù)據(jù)庫編程經(jīng)典300例
- Scala編程實(shí)戰(zhàn)
- INSTANT Apache ServiceMix How-to