View difference between Paste ID: FYxUXjpK and jSMPBnrv
SHOW: | | - or go back to the newest paste.
1-
[cosc801@bayou Program_3]$ ipcs
1+
2-
2+
The initial value of mutex is 1
3-
------ Shared Memory Segments --------
3+
4-
key        shmid      owner      perms      bytes      nattch     status
4+
5-
5+
6-
------ Semaphore Arrays --------
6+
Arriving        Males: 0        Females: 1
7-
key        semid      owner      perms      nsems
7+
Value of admit is 3
8-
8+
9-
------ Message Queues --------
9+
10-
key        msqid      owner      perms      used-bytes   messages
10+
Arriving        Males: 0        Females: 2
11-
11+
Value of admit is 6
12-
[cosc801@bayou Program_3]$ g++ Programming3.cpp -lrt
12+
13
Male patron #3 enters the club.
14-
The initial value of mutex is 0
14+
Value of admit is 5
15
Leaving Males: 1        Females: 2
16
Female patron #1 leaves the club.
17
Leaving Males: 1        Females: 1
18
Value of admit is 2
19
Male patron #4 arrives at club.
20
Male patron #4 enters the club.
21
Value of admit is 1
22
Leaving Males: 2        Females: 1
23
Male patron #5 arrives at club.
24
Male patron #5 enters the club.
25-
Female patron #7 enters the club.
25+
Value of admit is 0
26
Leaving Males: 3        Females: 1
27
Male patron #6 arrives at club.
28
Female patron #7 arrives at club.
29
Female patron #7 enters the club.
30
Arriving        Males: 3        Females: 2
31
Value of admit is 3
32
Male patron #6 enters the club.
33
Value of admit is 2
34
Leaving Males: 4        Females: 2
35
Female patron #7 leaves the club.
36
Leaving Males: 4        Females: 1
37
Value of admit is 1
38
Male patron #5 leaves the club.
39
Leaving Males: 3        Females: 1
40
Value of admit is 2
41
Male patron #3 leaves the club.
42
Leaving Males: 2        Females: 1
43
Value of admit is 3
44
Male patron #6 leaves the club.
45
Leaving Males: 1        Females: 1
46
Value of admit is 4
47
Female patron #2 leaves the club.
48
Leaving Males: 1        Females: 0
49
Value of admit is 3
50
Male patron #4 leaves the club.
51
Leaving Males: 0        Females: 0
52
Value of admit is 4
53
No one is in the club gettin' tipsy.