正在加载图片...
●●● ●●●● 6.1 Background ●●●●● ●●●● ●●0●● ●●●● Consumer ●●●● while(true)t while(count==0); //do nothing nextConsumed= buffer[out] out=out+ 1)% BUFFER SIZE count--, /* consume the item in nextconsumed*/ o The statements /* count=5*/ count++e l/Producer count-- ∥/ Consumer5 6.1 Background ⚫ Consumer while (true) { while (count == 0); // do nothing nextConsumed = buffer[out]; out = (out + 1) % BUFFER_SIZE; count--; /* consume the item in nextConsumed*/ } ⚫ The statements /* count=5 */ count++; //Producer count--; // Consumer
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有