Skip to content

Instantly share code, notes, and snippets.

@thekoc
Created December 19, 2016 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thekoc/d6414233e903805377a6f616a97f202f to your computer and use it in GitHub Desktop.
Save thekoc/d6414233e903805377a6f616a97f202f to your computer and use it in GitHub Desktop.
# 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