Script started on 2003³â 11¿ù 11ÀÏ (È­) ¿ÀÀü 03½Ã 19ºÐ 00ÃÊ [roke79@Proabi producer-consumer-relationship]$ ./a.out Go in the Critical Section by pid=1082337468 == pid=1082337468 == ** push 0 ***pid=1082337468 loop count 0 Go in the Critical Section by pid=1082337468 == pid=1082337468 == ** push 1 ***pid=1082337468 loop count 1 Go in the Critical Section by pid=1082337468 == pid=1082337468 == ** push 2 ***pid=1082337468 loop count 2 Go in the Critical Section by pid=1082337468 == pid=1082337468 == ** push 3 ***pid=1082337468 loop count 3 Go in the Critical Section by pid=1082337468 == pid=1082337468 == ** push 4 ***pid=1082337468 loop count 4 Go in the Critical Section by pid=1082337468 == pid=1082337468 == ** push 5 ***pid=1082337468 loop count 5 Go in the Critical Section by pid=1082337468 == pid=1082337468 == ** push 6 ***pid=1082337468 loop count 6 Go in the Critical Section by pid=1082337468 == pid=1082337468 == ** push 7 ***pid=1082337468 loop count 7 Go in the Critical Section by pid=1082337468 == pid=1082337468 == ** push 8 ***pid=1082337468 loop count 8 Go in the Critical Section by pid=1082337468 == pid=1082337468 == ** push 9 ***pid=1082337468 loop count 9 Go in the Critical Section by pid=1082337468 == pid=1082337468 | c_queue.max =10 == pid=1082337468 now sleeping! Go in the Critical Section by pid=1090725948 == pid=1090725948 | c_queue.max =10 == pid=1090725948 now sleeping! Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 0 ***consumer c_queue.max = 9pid=1082337468 wake up == c_queue.max=9 == pid=1082337468 == ** push 10 ***pid=1082337468 loop count 10 Go in the Critical Section by pid=1082337468 == pid=1082337468 | c_queue.max =10 == pid=1082337468 now sleeping! cid=1099114428 loop count 0 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 1 ***consumer c_queue.max = 9cid=1099114428 loop count 1 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 2 ***consumer c_queue.max = 8pid=1082337468 wake up == c_queue.max=8 == pid=1082337468 == ** push 11 ***pid=1082337468 loop count 11 Go in the Critical Section by pid=1082337468 == pid=1082337468 == ** push 12 ***pid=1082337468 loop count 12 Go in the Critical Section by pid=1082337468 == pid=1082337468 | c_queue.max =10 == pid=1082337468 now sleeping! cid=1099114428 loop count 2 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 3 ***consumer c_queue.max = 9cid=1099114428 loop count 3 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 4 ***consumer c_queue.max = 8cid=1099114428 loop count 4 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 5 ***consumer c_queue.max = 7cid=1099114428 loop count 5 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 6 ***consumer c_queue.max = 6cid=1099114428 loop count 6 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 7 ***consumer c_queue.max = 5cid=1099114428 loop count 7 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 8 ***consumer c_queue.max = 4cid=1099114428 loop count 8 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 9 ***consumer c_queue.max = 3cid=1099114428 loop count 9 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 10 ***consumer c_queue.max = 2cid=1099114428 loop count 10 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 11 ***consumer c_queue.max = 1cid=1099114428 loop count 11 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 12 ***consumer c_queue.max = 0cid=1099114428 loop count 12 Go in the Critical Section by cid=1099114428 == cid=1099114428 | c_queue.max =0 == cid=1099114428 now sleeping! pid=1090725948 wake up == c_queue.max=0 == pid=1090725948 == ** push 0 ***pid=1090725948 loop count 0 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 1 ***pid=1090725948 loop count 1 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 2 ***pid=1090725948 loop count 2 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 3 ***pid=1090725948 loop count 3 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 4 ***pid=1090725948 loop count 4 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 5 ***pid=1090725948 loop count 5 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 6 ***pid=1090725948 loop count 6 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 7 ***pid=1090725948 loop count 7 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 8 ***pid=1090725948 loop count 8 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 9 ***pid=1090725948 loop count 9 Go in the Critical Section by pid=1090725948 == pid=1090725948 | c_queue.max =10 == pid=1090725948 now sleeping! cid=1099114428 wake up == c_queue.max=10 == cid=1099114428 == *** pop 0 ***consumer c_queue.max = 9pid=1082337468 wake up == c_queue.max=9 == pid=1082337468 == ** push 13 ***pid=1082337468 loop count 13 Go in the Critical Section by pid=1082337468 == pid=1082337468 | c_queue.max =10 == pid=1082337468 now sleeping! cid=1099114428 loop count 13 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 1 ***consumer c_queue.max = 9cid=1099114428 loop count 14 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 2 ***consumer c_queue.max = 8cid=1099114428 loop count 15 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 3 ***consumer c_queue.max = 7cid=1099114428 loop count 16 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 4 ***consumer c_queue.max = 6cid=1099114428 loop count 17 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 5 ***consumer c_queue.max = 5cid=1099114428 loop count 18 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 6 ***consumer c_queue.max = 4cid=1099114428 loop count 19 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 7 ***consumer c_queue.max = 3cid=1099114428 loop count 20 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 8 ***consumer c_queue.max = 2cid=1099114428 loop count 21 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 9 ***consumer c_queue.max = 1cid=1099114428 loop count 22 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 13 ***consumer c_queue.max = 0cid=1099114428 loop count 23 Go in the Critical Section by cid=1099114428 == cid=1099114428 | c_queue.max =0 == cid=1099114428 now sleeping! pid=1090725948 wake up == c_queue.max=0 == pid=1090725948 == ** push 10 ***pid=1090725948 loop count 10 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 11 ***pid=1090725948 loop count 11 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 12 ***pid=1090725948 loop count 12 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 13 ***pid=1090725948 loop count 13 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 14 ***pid=1090725948 loop count 14 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 15 ***pid=1090725948 loop count 15 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 16 ***pid=1090725948 loop count 16 Go in the Critical Section by pid=1090725948 == cid=1099114428 wake up == c_queue.max=7 == cid=1099114428 == *** pop 10 ***consumer c_queue.max = 6cid=1099114428 loop count 24 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 11 ***consumer c_queue.max = 5cid=1099114428 loop count 25 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 12 ***consumer c_queue.max = 4cid=1099114428 loop count 26 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 13 ***consumer c_queue.max = 3cid=1099114428 loop count 27 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 14 ***consumer c_queue.max = 2cid=1099114428 loop count 28 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 15 ***consumer c_queue.max = 1cid=1099114428 loop count 29 Go in the Critical Section by cid=1099114428 == cid=1099114428 == *** pop 16 ***consumer c_queue.max = 0cid=1099114428 loop count 30 Go in the Critical Section by cid=1099114428 == cid=1099114428 | c_queue.max =0 == cid=1099114428 now sleeping! pid=1090725948 == ** push 17 ***cid=1099114428 wake up == c_queue.max=1 == cid=1099114428 == *** pop 17 ***consumer c_queue.max = 0cid=1099114428 loop count 31 Go in the Critical Section by cid=1099114428 == cid=1099114428 | c_queue.max =0 == cid=1099114428 now sleeping! pid=1090725948 loop count 17 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 18 ***cid=1099114428 wake up == c_queue.max=1 == cid=1099114428 == *** pop 18 ***consumer c_queue.max = 0cid=1099114428 loop count 32 Go in the Critical Section by cid=1099114428 == cid=1099114428 | c_queue.max =0 == cid=1099114428 now sleeping! pid=1090725948 loop count 18 Go in the Critical Section by pid=1090725948 == pid=1090725948 == ** push 19 ***cid=1099114428 wake up == c_queue.max=1 == cid=1099114428 == *** pop 19 ***consumer c_queue.max = 0cid=1099114428 loop count 33 Go in the Critical Section by cid=1099114428 == cid=1099114428 | c_queue.max =0 == cid=1099114428 now sleeping! pid=1090725948 loop count 19 pid=1090725948 pthread exit == loop count 20 [1]+ Stopped ./a.out