官术网_书友最值得收藏!

Working with coroutines

A program in execution that initiates long-running operations, such as file IO, network IO, or CPU- or GPU-intensive work, requires the invoker to block until the operations complete. Programming languages handle this via concurrency. 

The JVM has support for concurrency. Java has had strong support for multithreading and concurrency since its first release. Any process that is running inside the JVM can create a number of threads to execute multiple tasks in an asynchronous fashion. However, developing concurrent code in an optimal and error-free manner and debugging it is really challenging. Java provides various constructs to write concurrent code and, along with other JVM languages and third-party libraries, has tried to come up with innovative and elegant ways to achieve concurrency.

Java 5 made a lot of progress with regard to writing concurrent applications. It has higher-level constructs, such as the executor framework, which makes it easier to write concurrent code and allows us to decouple thread management code from the business logic. Java 8 has introduced parallel streams to turn the code to concurrent much more easily. RxJava brings reactive extensions to Java, allowing us to write very concise code for asynchronous functionality. Kotlin supports almost all of those approaches and offers a few of its own as well.

主站蜘蛛池模板: 封丘县| 连山| 民丰县| 漳州市| 宣汉县| 江源县| 富宁县| 海淀区| 萝北县| 锦屏县| 板桥市| 密山市| 来宾市| 金堂县| 抚宁县| 昌江| 临夏县| 甘洛县| 东乡族自治县| 铜川市| 卢龙县| 石首市| 综艺| 济宁市| 双牌县| 盱眙县| 凤山市| 眉山市| 韩城市| 呼伦贝尔市| 广宗县| 盱眙县| 青冈县| 吉林市| 奉贤区| 吴堡县| 白朗县| 宜章县| 儋州市| 吐鲁番市| 苏尼特左旗|