像标准的线程模块,但是awesomer

threading2的Python项目详细描述


线程2:类似于标准线程模块,但是是一个awesomer。

此模块设计为默认值的替换和扩展 “线程”模块。它有两个主要目标:

  • implement primitives using native platform functionality where possible
  • expose more sophisticated functionality where it can be done uniformly

当前实现了以下扩展:

  • ability to set (advisory) thread priority
  • ability to set (advisory) CPU affinity at thread and process level
  • thread groups for simultaneous management of multiple threads
  • SHLock class for shared/exclusive (also known as read/write) locks

还包括以下API细节:

  • all blocking methods take a “timeout” argument and return a success code
  • all exposed objects are actual classes and can be safely subclassed

这目前只在winxp和ubuntu karmic上测试过;类似的 平台应该正常工作,其他平台应该重新使用 合理的违约行为,但现阶段我不会做出任何保证。

其他计划的扩展包括:

  • make stack_size a kwarg when creating a thread
  • native events, semaphores and timed waits on win32
  • native conditions and timed waits on pthreads platforms
  • native SHLock implementations (SRW on Win Vista+, pthread_rwlock)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
apache commons 3.1中的java httpClient代理支持   ubuntu 14.04 Java:找不到类Xmx1g   java如何用当前用户的数据填充recyclerview?   java Alter Hibernate事务超时仅用于一种方法?   如果没有pow()、函数或递归,如何在c/c++中使用幂函数   java将html UI与本机安卓应用程序相结合   创建GridPane子项时发生java错误   java在基类构造函数中调用虚方法   客户端重新连接javasocket   具有建议日期的java Open DatePicker   雅加达ee Java ee请求范围和异步   classnotfoundexception无法执行目标组织。科德豪斯。项目<projectname>上的mojo:execmavenplugin:1.6.0:java(defaultcli):   java字符串内容相同,但equals方法返回false   primefaces调度的java问题   java帮助我理解关于实现接口的这一课   java Jsoup在下载页面文本时将所有url分离   java将字符串转换为整数错误   java如何从mapDB数据库中检索数据,而不必每次都重写它?