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

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.

主站蜘蛛池模板: 玛沁县| 沿河| 新野县| 龙陵县| 长宁县| 平果县| 永顺县| 垣曲县| 大竹县| 萨嘎县| 大悟县| 临西县| 贵港市| 榆社县| 资溪县| 西乡县| 隆化县| 西丰县| 甘孜| 额济纳旗| 苍梧县| 夏河县| 永济市| 辽宁省| 怀远县| 新化县| 南宁市| 新和县| 石林| 温泉县| 宾阳县| 东山县| 淮安市| 汝南县| 来凤县| 莒南县| 商都县| 措勤县| 阿鲁科尔沁旗| 静安区| 简阳市|