Skip to content

Commit 20b159c

Browse files
committed
Fix the language.
1 parent 4ce19b6 commit 20b159c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

semaphores/talking-heads.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* <n> processes share one semaphore initialized with <init>. Every moment,
33
* <init> processes can talk at the same time. When talking, each process say
44
* its number every second for a random number of seconds up to a certain
5-
* maximum (say, 5). Each round, every process talks at least once. They keep
6-
* doing this until SIGINT is sent. Every round, the last number is in () so
7-
* that we know that process is gonna shut up. As a special case, with <init>
8-
* to be 1, only one process at a time can talk.
5+
* maximum (say, 5). When a process gets to talk, it talks at least once. They
6+
* keep doing this until SIGINT is sent. Every turn, the last number is in ()
7+
* so that we know that process is gonna shut up. As a special case, with
8+
* <init> to be 1, only one process at a time can talk.
99
*
1010
* $ ./a.out 9 1
1111
* 000(0)11(1)2(2)(3)444(4)5(5)(6)...
@@ -18,11 +18,11 @@
1818
*
1919
* After sem_post(), you might need a short sleep to give other processes a
2020
* chance to wake up otherwise only a small group of processes could actually
21-
* take turns -- ie. if after sem_post() the process could immediatelly do
21+
* take turns -- ie. after sem_post() the process could immediatelly do
2222
* sem_wait() and be itself the one that actually decrements the semaphore
23-
* again.
23+
* again, thus starving out other processes.
2424
*
25-
* Wait for all children before returning from the parent.
25+
* Wait for all children before exiting from the parent.
2626
*
2727
* You must link with -pthread on Linux.
2828
*

0 commit comments

Comments
 (0)