Created
December 19, 2016 08:22
-
-
Save thekoc/d6414233e903805377a6f616a97f202f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# encoding=utf8 | |
from __future__ import print_function | |
import multiprocessing | |
def heat(): | |
print("I'm so hot") | |
while True: | |
pass | |
def main(): | |
p = multiprocessing.Pool() | |
for i in range(multiprocessing.cpu_count()): | |
p.apply_async(heat) | |
p.close() | |
p.join() | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment