正在加载图片...
●●● ●●●● 6.2 The Critical-Section Problem::: ●●●● critical section of producer ●●●● while(count = BUFFER SIZE); buffer [in]= nextProduced in=(in+ 1)% BUFFER SIzE, count++ critical section of consumer while(count ==0); nextconsumed= buffer[out out=(out +1% BUFFER_ SIZE count--:14 6.2 The Critical-Section Problem critical section of producer while (count == BUFFER_SIZE); buffer [in] = nextProduced; in = (in + 1) % BUFFER_SIZE; count++; critical section of consumer while (count == 0); nextConsumed = buffer[out]; out = (out + 1) % BUFFER_SIZE; count--;
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有