Skip to content

Commit f2dbb7b

Browse files
authored
5: Processes and etc. | Update README
1 parent 7795f10 commit f2dbb7b

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

5_Processes_Signals_Files_Pipes/README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
Some simple tasks from the course + additional practice with my own examples:
55
|||
66
|-------------------|-----------------------------------------------------------|
7-
|1. `Processes/exec_cat.cpp` | Just execute cat in forked proccess with error checks |
7+
|1. `Processes/1_exec-cat.cpp` | Just execute cat in forked proccess with error checks |
8+
|2. `Processes/2_Zombie-checker.cpp` | Checking zombie child processes in non-blocking mode |
89

910

1011

1112

1213
## Result
1314

14-
### `Processes/exec_cat.cpp`
15+
### `Processes/1_exec-cat.cpp`
1516

1617
Simple exec in forked process (after 1 sec sleep) with reusing argv parameters with.
1718

@@ -20,7 +21,27 @@ Simple exec in forked process (after 1 sec sleep) with reusing argv parameters w
2021
![Screen Recording 2022-03-17 at 12 09 31 PM](https://user-images.githubusercontent.com/44144647/158776572-3c0f3b56-28a8-492b-af01-83faa5a3a80b.gif)
2122

2223

24+
### `Processes/2_Zombie-checker.cpp`
2325

26+
Fork `CHILDS_NUMBER` processes (with 1 seconds delay between) and make them sleep for `5 + std::rand() % 20` seconds (each process has own random seed).
2427

25-
## Learned new
28+
After fork main process doing `some hard work` and each `WORK_DELAY` seconds calls `zombie_check()` in non-blocking mode.
29+
30+
##### runtime
31+
32+
![Screen Recording 2022-03-17 at 1 52 17 PM](https://user-images.githubusercontent.com/44144647/158794971-b93aeb31-de99-4868-b71f-34829766ef27.gif)
33+
34+
35+
### `Signals/1_Immortal.cpp`
36+
37+
Just making immortal (ignoring `SIGINT` and `SIGTERM`) child process.
2638

39+
##### runtime
40+
41+
![Screen Recording 2022-03-17 at 12 29 11 PM](https://user-images.githubusercontent.com/44144647/158795441-6ad4b09a-ec8f-40c1-8f65-493f366bc1bf.gif)
42+
43+
44+
45+
## Learned new
46+
* Non-blocking `waitpid`'s flag (`WNOHANG`)
47+
* ANSI, POSIX and Real Time signals

0 commit comments

Comments
 (0)