From 999d09359b05c8547ae8c488e6e71b6181f4cac5 Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Sun, 10 Oct 2021 19:49:24 +0200 Subject: [PATCH] better programs readme --- programs/README.md | 5 +++-- programs/simple.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/programs/README.md b/programs/README.md index d843b2c..073c36b 100644 --- a/programs/README.md +++ b/programs/README.md @@ -2,8 +2,9 @@ Note that these programs are of poor quality. -* `simple.c` does some arithmetic in a loop, occasionally prints something rather random (the sequence goes `90,90,90,2386,2386,ae86,520c,1cbdc,1cbde...`) -* `spawn.c` this thing spawn a new thread and exits when the thread overwrites a value. +* `simple.c` does some arithmetic in a loop and prints some numbers. +* `spawn.c` this programs spawns a new thread and exits when the thread overwrites a value. +* `threads.c` this program spawns two threads and waits for them to exit. The threads sleep for some time before exiting. ## Compiling diff --git a/programs/simple.c b/programs/simple.c index 2637b7f..100385a 100644 --- a/programs/simple.c +++ b/programs/simple.c @@ -13,6 +13,7 @@ int main() int a = 144; while (1) { + // do some nonsense calculation just to be busy for (int i = 0; i < 10000; i++) { for (int j = 0; j < 10000; j++) { a ^= (((a << 16) ^ a) & i) << 4;