Or am I now able to transfer objects between threads? Often times I might want to do several things in the background on a single worker involving several dependencies? Is something like that possible with this threading model?
o
olonho
12/01/2017, 6:04 AM
Yes, you can transfer objects between workers. We try to avoid notion of thread, as it is misleading, but workers are executed on top of OS threads.
s
spierce7
12/01/2017, 5:02 PM
Is there a 1-1 mapping between a worker and an OS thread?
o
olonho
12/04/2017, 6:52 AM
Not 1:1, not for every thread there's worker, but for every worker ther is a thread
s
spierce7
12/05/2017, 7:33 PM
So workers don't share threads?
o
olonho
12/06/2017, 6:05 AM
Sure, the whole idea beyond workers is computations offload, if you want to share threads - coroutines are way to go.
s
spierce7
12/11/2017, 12:45 AM
Can you recommend a sample of kotlin-native coroutines that offload work to background threads?