Hey! so is I am getting started with multiprocessi...
# getting-started
a
Hey! so is I am getting started with multiprocessing and wanted to know if there is something similar to pythons Pool.map() in kotlin?
r
Not familiar with "multiprocessing" in Python, but you likely want to check out #coroutines and #flow.
g
Right, coroutines is way to go. But also if you just want to do multi-thread processing and want efficiently split a big, cpu heavy, job you can use Java parallel streams, it’s a very efficient way to do this, but coroutines are more general solution
s
An issue with Java parallel streams is that you don't have control over the threadpool (it's a shared threadpool for the whole application). If you need more fine-grained control, check out
ExecutorService
from the Java std/lib. But check out Coroutines first.