fun <T1, T2> execute( mode: TransferMode, producer: () -> T1, job: (T1) -> T2 ): Future<T2>
Plan job for further execution in the worker. Execute is a two-phase operation:
Parameter mode has no effect.
Behavior is more complex in case of legacy memory manager:
kotlin.IllegalStateException so kotlin.native.runtime.GC.collect() could be called in the end of producer and job if garbage cyclic structures or other uncollected objects refer to the value being transferred.Return the future with the computation result of job.
© 2010–2023 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native.concurrent/-worker/execute.html