RubyGems Navigation menu

improved-queue 1.0

A simple elaboration on Ruby's native SizedQueue which allows using the queue object to re-awaken a blocked thread and cause it to abandon its blocking enqueue/dequeue operation. Useful for simplifying program logic, reducing the need for external flags/Muteces (yes, I said Muteces), and for cleanly resolving queues on program termination without risk of data loss or deadlock. Why use this queue? There are two reasons. For one thing, under several circumstances it is _considerably_ faster than Ruby's native SizedQueue. I admit I'm not entirely sure why, but I have tested this on multiple platforms and it seems to hold true as a generality. You can feel free to confirm or dispel that this advantage holds for your use case at your own leisure. The second reason is the aforementioned simplification of program logic. In the case that all data passing through the queues must be preserved on program termination, SizedQueue can require some elaborate trickery to ensure that even the most remote possibility of deadlock is removed. ImprovedSizedQueue solves this problem by making it possible to use the queue to pass control messages between threads, irrespective of the queue's actual content.

Gemfile:
= 复制到剪贴板 已复制!

安装:
=

版本列表:

  1. 1.0 - October 31, 2013 (8.0 KB)

业主:

作者:

  • Lincoln McCormick

SHA 256 校验和:

bd1e0d8cb7d58219b1e4ce7e4674851fd57040e6ee99d62d068ef0122cdf4ebe

下载总量 3,585

这个版本 3,585

许可:

GPL v3

需要的 Ruby 版本:

链接: