Skip to content

Instantly share code, notes, and snippets.

@vKxni
Created November 18, 2022 21:08
Show Gist options
  • Save vKxni/edfc99b8099991232ec3fd25926d19fa to your computer and use it in GitHub Desktop.
Save vKxni/edfc99b8099991232ec3fd25926d19fa to your computer and use it in GitHub Desktop.
A funny way to create 1000 processes
-module(spam_pids).
-export([main/0]).
main() ->
Pids = lists:map(fun(_) -> spawn(fun() -> ok end) end, lists:seq(1, 1000)),
lists:foreach(fun(Pid) -> exit(Pid, normal) end, Pids).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment