Multi-threading should be used to run the tasks in parallel. See https://docs.python.org/3/library/threading.html.