官术网_书友最值得收藏!

Fast producer and slow consumer

The second problem is much more complicated. Suppose we have a fast producer and slow consumer. The problem here is that the producer may send much more data than the consumer can process, which may lead to a catastrophic failure of the component under stress.

One intuitive solution for such case is collecting unhandled elements into the queue, which may stay between the producer and consumer or may even reside on the consumer side. Even if the consumer is busy, such a technique makes it possible to handle new data by processing the previous element or portion of data. 

One of the critical factors for handling pushed data using the queue is to choose a queue with proper characteristics. In general, there are three common types of queue, which are considered in the following subsections.

主站蜘蛛池模板: 巩留县| 井冈山市| 孝昌县| 祁阳县| 巴东县| 佛学| 瑞金市| 镇巴县| 布拖县| 郑州市| 杨浦区| 东源县| 东港市| 巫溪县| 文化| 常宁市| 西乡县| 民和| 内乡县| 平定县| 南通市| 从化市| 勃利县| 湖南省| 虞城县| 福安市| 于都县| 金山区| 拜城县| 龙州县| 天气| 香河县| 龙陵县| 湛江市| 开化县| 云林县| 苏尼特右旗| 安徽省| 高清| 清丰县| 山东省|