1.1 KiB
1.1 KiB
Fork vs Threads Experiments
This project compares Linux process creation (fork) versus thread creation (pthreads). It includes timing, scaling, and stress tests to show performance differences and system limits.
How to run
Run all experiments (safe by default):
bash run_all_experiments.sh
Run individual experiments (examples):
bash creation_time_experiment/bash_test_iter.sh
bash thread_recursive_scaling/run_thread_recursive.sh
Enable the dangerous stress tests (timeboxed):
ALLOW_DANGEROUS=1 FORK_BOMB_SECONDS=5 MAX_LIMIT_SECONDS=5 bash run_all_experiments.sh
Potential dangers
- The fork bomb and max-limit stress tests can freeze your machine or make it unresponsive by exhausting processes/threads.
- You may need elevated limits (ulimit or sysctl) to run high-stress tests.
- Running heavy tests on shared systems or laptops can disrupt other users and risk data loss if the system becomes unstable.
If you are unsure, do not enable the dangerous tests.
It is very important to run above test in virtual machine to avoid some of the potential dangers