You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|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 |
9
+
|2. `Signals/1_Immortal.cpp`| Just making immortal (ignoring `SIGINT` and `SIGTERM`) child process |
8
10
9
11
10
12
11
13
12
14
## Result
13
15
14
-
### `Processes/exec_cat.cpp`
16
+
### `Processes/1_exec-cat.cpp`
15
17
16
18
Simple exec in forked process (after 1 sec sleep) with reusing argv parameters with.
17
19
@@ -20,7 +22,27 @@ Simple exec in forked process (after 1 sec sleep) with reusing argv parameters w
20
22

21
23
22
24
25
+
### `Processes/2_Zombie-checker.cpp`
23
26
27
+
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).
24
28
25
-
## Learned new
29
+
After fork main process doing `some hard work` and each `WORK_DELAY` seconds calls `zombie_check()` in non-blocking mode.
30
+
31
+
##### runtime
32
+
33
+

34
+
35
+
36
+
### `Signals/1_Immortal.cpp`
37
+
38
+
Just making immortal (ignoring `SIGINT` and `SIGTERM`) child process.
26
39
40
+
##### runtime
41
+
42
+

0 commit comments