it's better to replace sleep() by singlelock. for putvalue: inputlock[in].lock;value[in] = i;ouputlock[in].unlock;in=(in+1)%QUEUESIZE. for getvalue: outputlock[out].lock;result = value[out];inputlock[out].unlock;out=(out+1)%QUEUESIZE.

scorpio (scorpio)
(#89008@0)
2001-6-3 -05:00

回到话题: Computer Jobs need true skills----see these assignments, please

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论

URL:   
http://www.rolia.net/zh/post.php?f=0&p=89008