'ThreadPoolExecutor - how do I execute both functions func1 and func2 at the same time? I see that these are not getting executed one after the other
with ThreadPoolExecutor(max_workers=5) as executor:
task1 = executor.submit(func1,argument1,argument2)
task2 = executor.submit(func2,argument1,argument2)
#Note this Func2 doesn't return any value
result1, result2 = task1.result()
result3 = task2.result()
ThreadPoolExecutor - how do I execute both functions func1 and func2 at the same time? I see that these functions are getting executed one after the other and not simultaneously .
Also kindly note func1 returns value1,value2 but func2 doesn't return any value
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
