Coroutines in KotlinBreslav@JetBrains.com This talk could have been named... • async/await/yield • fibers Suspendable Computations • [stackless] continuations ## Outline • Motivation/Examples • Solutions in other languages Very bad.  ## Suspendable Computation asyncUI val image Suspending (loadImage(url)) Time-consuming operation myUI.setImage(image)0 码力 | 39 页 | 1.01 MB | 2 年前3
Kotlin language specification
Version 1.9-rfc+0.1Continuation Passing Style Each suspendable function goes through a transformation from normally invoked function to continuation passing style (CPS). For a suspendable function with parameters $ p_{1} kotlin.Any?. The calling convention for such function is different from regular functions as a suspendable function may either suspend or return. • If the function returns a result, it is returned directly return type T and COROUTINE_SUSPENDED. #### 18.3.3 Coroutine state machine Kotlin implements suspendable functions as state machines, since such implementation does not require specific runtime support0 码力 | 310 页 | 1.39 MB | 2 年前3
Kotlin 1.2 Language Documentationinstance: data class Result(val result: Int, val status: Status) fun function(...) : Result { // computations return Result(result, status) } // Now, to use this function: val (result, status) = function( frameworks like Quasar, which uses annotations for concurrency control. annotation class Suspendable val f = @Suspendable { Fiber.sleep(10) } Annotation Use-site Targets When you're annotating a property ("main")) { log("Started main coroutine") // run two background value computations val v1 = async(CoroutineName("v1coroutine")) { delay(500) log("Computing0 码力 | 333 页 | 2.22 MB | 2 年前3
Kotlin Language Documentation 1.9.20between Android and iOS to implement networking, data storage and data validation, analytics, computations, and other application logic. Check out the Get started with Kotlin Multiplatform and Create on the heap instead of using the actual call stack. This allows you to run very deep recursive computations. To call a deep recursive function, invoke it. In this example, a deep recursive function is properties in the IR compiler. // lazy initialization val a = run { val result = // intensive computations println(result) result } // run is executed upon the first usage of the variable0 码力 | 1299 页 | 32.44 MB | 2 年前3
Kotlin Language Documentation 1.3adds some overhead which may be significant when processing smaller collections or doing simpler computations. Hence, you should consider both Sequence and Iterable and decide which one is better for your instance: data class Result(val result: Int, val status: Status) fun function(...): Result { // computations return Result(result, status) } // Now, to use this function: val (result, status) = function( frameworks like Quasar, which uses annotations for concurrency control. annotation class Suspendable val f = @Suspendable { Fiber.sleep(10) } ## Annotation Use-site Targets When you're annotating0 码力 | 597 页 | 3.61 MB | 2 年前3
Kotlin 1.9.10 官方文档 中文版
on the heap instead of using the actual call stack. This allows you to run very deep recursive computations. To call a deep recursive function, invoke it. In this example, a deep recursive function is properties in the IR compiler. // lazy initialization val a = run { val result = // intensive computations println(result) result } // run is executed upon the first usage of the variable lambda 表达式体的 invoke() 方法上。这对于像 Quasar 这样的框 架很有用, 该框架使用注解进行并发控制。 annotation class Suspendable val f = @Suspendable { Fiber.sleep(10) } 注解使用处目标 当对属性或主构造函数参数进行标注时,从相应的 Kotlin 元素生成的 Java 元素会有多个,因此在生成的0 码力 | - 页 | 22.65 MB | 2 年前3
Kotlin 官方文档中文版 v1.9on the heap instead of using the actual call stack. This allows you to run very deep recursive computations. To call a deep recursive function, invoke it. In this example, a deep recursive function is properties in the IR compiler. // lazy initialization val a = run { val result = // intensive computations println(result) result } // run is executed upon the first usage of the variable 表达式。它们会被应用于生成 lambda 表达式体的 invoke() 方法上。这对于像 Quasar 这样的框架很有用,该框架使用注解进行并发控制。 annotation class Suspendable val f = @Suspendable { Fiber.sleep(10) } ## 注解使用处目标 当对属性或主构造函数参数进行标注时,从相应的 Kotlin 元素生成的 Java 元素会有多个,因此在生成的0 码力 | 2049 页 | 45.06 MB | 2 年前3
Jupyter Notebook 6.2.0 Documentationmathematics, computations and their rich media output. Notebook documents: a representation of all content visible in the web application, including inputs and outputs of the computations, explanatory completion/introspection. - The ability to execute code from the browser, with the results of computations attached to the code which generated them. - Displaying the result of computation using rich {}, "source": [ "The kernel maintains the state of a notebook's computations. You can reset this state by restarting the kernel. This is done by clicking on the
Jupyter Notebook 6.4.4 Documentationmathematics, computations and their rich media output. Notebook documents: a representation of all content visible in the web application, including inputs and outputs of the computations, explanatory completion/introspection. - The ability to execute code from the browser, with the results of computations attached to the code which generated them. - Displaying the result of computation using rich {}, "source": [ "The kernel maintains the state of a notebook's computations. You can reset this state by restarting the kernel. This is done by clicking on the
Data Is All You Need for Fusionget_data(), 1, y.get_data(), 1, A.get_data(), R.m); ## Accelerate Make large-scale mathematical computations and image performance and low energy consumption. Accelerate | simd | iOS 4.0+ | iPadOS 4.0+ A=\alpha(x\times y^{\mathrm{T}})+\beta A $$ ## Technology ## Accelerate Make large-scale mathematical computations and image performance and low energy consumption. Accelerate | simd | iOS 4.0+ | iPadOS 4.0+ A=\alpha(x\times y^{\mathrm{T}})+\beta A $$ ## Technology ## Accelerate Make large-scale mathematical computations and image performance and low energy consumption. Accelerate | simd | iOS 4.0+ | iPadOS 4.0+0 码力 | 151 页 | 9.90 MB | 1 年前3
共 519 条
- 1
- 2
- 3
- 4
- 5
- 6
- 52
相关搜索词
coroutinesasync/awaitfiberssuspendable computationscontinuationsKotlinmultiplatformtype systemsyntaxcompatibilityKotlin 1.2数学运算API序列操作集合操作反射改进K2 compilerKotlin/Nativememory allocatorGradleKotlin MultiplatformCoroutinesMultiplatform ProjectsInline classesContractsProgressive mode1.9.10新特性兼容性指南翻译同步Kotlin 1.9语言版本移除正则表达式捕获组编译器错误修正Jupyter Notebookweb applicationNotebook documentsMarkdownMathJaxChangelogBugs fixedupgradeConfigurationDataFusionMatrix MultiplyScaleAdd













