易截截图软件、单文件、免安装、纯绿色、仅160KB

[Python module] queue

8.8. queue — A synchronized queue class¶
queue -- 一个同步队列类
The queue module implements multi-producer, multi-consumer queues. It is especially useful in threaded programming when information must be exchanged safely between multiple threads. The Queue class in this module implements all the required locking semantics. It depends on the availability of thread support in Python; see the threading module.
queue模块处理多生产者和多消费者的队列。在多线程间信息的安全交换非常有用。这个module的Queue类处理所需的locking语义,它依赖于threading模块。
Implements three types of queue whose only difference is the order that the entries are retrieved. In a FIFO queue, the first tasks added are the first retrieved. In a LIFO queue, the most recently added entry is the first retrieved (operating like a stack). With a priority queue, the entries are kept sorted (using the heapq module) and the lowest valued entry is retrieved first.
三种类型的队列,FIFO,LIFO,以及优先队列(使用heapq模块,先取得低优先级)。
The queue module defines the following classes and exceptions:
class queue.Queue(maxsize)¶Constructor for a FIFO queue. maxsize is an integer that sets the upperbound limit on the number of items that can be placed in the queue. Insertion will block once this size has been reached, until queue items are consumed. If maxsize is less than or equal to zero, the queue size is infinite.
创建FIFP队列。maxsiaze <= 0, 无限制
class queue.LifoQueue(maxsize)¶Constructor for a LIFO queue. maxsize is an integer that sets the upperbound limit on the number of items that can be placed in the queue. Insertion will block once this size has been reached, until queue items are consumed. If maxsize is less than or equal to zero, the queue size is infinite.
创建LIFO队列。maxsiaze <= 0, 无限制
class queue.PriorityQueue(maxsize)¶
Constructor for a priority queue. maxsize is an integer that sets the upperbound limit on the number of items that can be place


相关文档:

Performance Python Vs Java


* java强制使用OO进行应用开发,Python可以用函数式编程。函数式有时显得非常简单,代码量巨减。回想起Java动不动的N层、还有一个个对象,真的有那种心要吗?而且Python本身语言风格就简洁,再加上简洁的函数,在开发效率、Debug、测试上似乎会有优势。
* 大型复杂项目的性能更多地体现在架构、硬件拓扑结构上等。应对 ......

arcgis python脚本

Script Name: Spider_Create   
#Script Label: Create Spider Diagrams   
#   
#Description:  Custom python script developed to create spider diagrams from points contained   
#in one or two feature classes.  If using two fea ......

Python快速入门

1. 第一章 Python快速入门
本章是Python的快速入门,在这一章并不涉及python的特殊规则和细节,目标是通过示例使你快速了解Python语言的特点。本章简要介绍了变量,表达式,控制流,函数以及输入/输出的基本概念,在这一章不涉及Python语言的高级特性。尽管如此,有经验的程序员还是能够通过阅读本章的材料创建高级程序。我们 ......

python 数据库

def Start(self):
        if (self.conn == None) or (self.conn.State == 1):
            self.conn = win32com.client.Dispatch(r'ADODB.Connection')
          &n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号