Run multiple cells in Colab at the same time

Viewed 1395

I have been searched the answer for a while. The answers include using Ipyparallel, but there are no clear instructions on how can I do to apply to two cells in general. Most of the examples are just compute some value with some functions distributively. They are at least not clear for me to understand how to solve the problem. I wish someone could provide some code or instructions on how can I do for running two independent cells in general on Colab. Or, if there are other methods, it is also fine as long as it works. Thank you.

1 Answers

It's not exactly straightforward, because Python is synchronous by default. Maybe encapsulating your cells in functions and using asyncio to execute two functions asynchronously will do the job. Or, if it includes something like heavy processing, threading or multiprocessing modules may be the way to go.

Related