Turn On/Off pids on notifying other processes.
[wsti_so.git] / README
1 Project created for passing Operating Systems subject in
2 High School of Information Technology
3
4
5 Example usages
6 --------------
7
8 Without bootstrap program
9 =========================
10
11 In separate terminals enter:
12 $ ./bin/process1
13 $ ./bin/process2
14 $ ./bin/process3
15
16 After that in terminal with process1 running enter some characters followed by
17 new line (ENTER).
18
19 - Process1 displays information about data buffer and how many bytes has been
20   sent to process2.
21 - Process2 displays information about received bytes, prints to stderr info
22   about number of characters in buffer, and sent this value to process3.
23 - Process3 displays information about number of entered characters.
24
25 With bootstrap program
26 ======================
27
28 In terminal, go to the ./bin directory (where compiled programs resides).
29 Execute:
30 $ ./bootstrap
31
32 After that there should be shown info about spawning new processess.
33 You can now pass to the standard input of the first spawned process data, .e.g:
34 $ echo "qwertyuiop" > /proc/(process 0 pid)/fd/3
35
36 If process creation was completed without errors, you should see following output:
37 [process2] Fetched: 11 bytes
38 [process2] Calculated: 10 characters. Sending...
39 [process3] Fetched: 4 bytes
40 [process3] Process2 send: 10
41
42 Signalling
43 ==========
44
45 After bootstrapping processes, you can send them signals.
46 Processes registers custom handlers for following ones:
47 - SIGUSR1 (User defined signal 1) - used for internal purposes. Signal must be
48   sent in pair with message queue.
49 - SIGTERM (Terminated) - additionaly to standard behaviour, this signal allows
50   releasing aquired resources and notify other processes using SIGUSR1 to do the
51   same.
52 - SIGTSTP (Stopped) - additionaly to standard behaviour, this signal allows
53   holding aquired resources (closes pipes for example), and notify other
54   processes using SIGUSR1 to do the same.
55 - SIGCONT (Continued) - aditionaly to standard behaviour, this signal allows
56   resume process working by opening closed pipes, and notify other processes
57   using SIGUSR1 to do the same.