Created
May 10, 2019 07:16
-
-
Save odoku/d2787d8c1c84d424f7f8f41e231a7444 to your computer and use it in GitHub Desktop.
python - threading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import concurrent.futures | |
def wait(): | |
print('Waiting') | |
for x in range(10 ** 100): | |
z = 10 + 20 | |
print('Done') | |
def main(): | |
executor = concurrent.futures.ThreadPoolExecutor(max_workers=10) | |
for x in range(0, 10): | |
executor.submit(wait) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment