Hey! Is it expected that multithreading doesn’t wo...
# intellij
m
Hey! Is it expected that multithreading doesn’t work in scratch files? I just tried to run some Kotlin code that creates threads inside the scratch file and it doesn’t seem to work. It doesn’t crash but I can’t see the output.
j
I've seen a problem where code that returns a value that you ignore doesn't get executed. e.g. side effects are ignored.. So might not be thread specific
a
Maybe you just need to wait for all the threads to finish?
normally if you reach the end of scratch file the execution will be stopped
j
Yes, you should have a join or equivalent at the end so the main thread doesn't terminate while children are doing work
m
Oh that makes sense. I haven't thought of that. Will try it, thanks!