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

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.

主站蜘蛛池模板: 延庆县| 辽阳市| 梅河口市| 修水县| 华蓥市| 浮山县| 嘉义县| 石狮市| 秭归县| 阿勒泰市| 兴隆县| 朝阳区| 东乌| 嫩江县| 襄樊市| 新沂市| 大连市| 石楼县| 宜兰市| 枣强县| 靖远县| 桃园县| 托克逊县| 安仁县| 抚宁县| 河东区| 万山特区| 南宁市| 天祝| 永新县| 九龙城区| 封开县| 阿城市| 项城市| 香港 | 马公市| 平陆县| 韩城市| 大同县| 临湘市| 同心县|