From 698fe99623ab182fbbd95c22a58aa651e5db285c Mon Sep 17 00:00:00 2001 From: andreastaliad Date: Fri, 22 May 2026 17:13:12 +0300 Subject: [PATCH] added README --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..282292a --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# 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): + +```sh +bash run_all_experiments.sh +``` + +Run individual experiments (examples): + +```sh +bash creation_time_experiment/bash_test_iter.sh +bash thread_recursive_scaling/run_thread_recursive.sh +``` + +Enable the dangerous stress tests (timeboxed): + +```sh +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.