- 博客(5)
- 资源 (10)
- 收藏
- 关注
原创 Python多线程4:_thread
_thread模块是threading模块的基础模块,为多线程提供了低级别的基元(也称为轻量级进程或任务)。为了同步,简单的锁(也叫做互斥锁或二元信号量)被提供。threading模块在该模块的基础上提供了更易使用并且更高级别的线程API。该模块支持Windows、Linux、SGI IRIX、Solaris 2.x、以及任何实现了POSIX线程的系统。_thread模块它定义了如
2015-06-26 09:54:27 5699
原创 Python多线程3:queue
queue模块实现了多生产者,多消费者队列。在多线程环境下,该队列能实现多个线程间安全的信息交换。queue模块介绍模块实现了3种类型的队列,区别在于队列中条目检索的顺序不同。在FIFO队列中,按照先进先出的顺序检索条目。在LIFO队列中,最后添加的条目最先检索到(操作类似一个栈)。在优先级队列中,条目被保存为有序的(使用heapq模块)并且最小值的条目被最先检索。queue模块定
2015-06-25 12:51:27 6288
原创 Python多线程2:sched
sched模块提供了一个用于事件调度的类。scheduler类定义class sched.scheduler(timefunc=time.monotonic, delayfunc=time.sleep) scheduler类为事件调度定义了一套通用接口。它需要传入两个函数:1)timefunc是一个没有参数的callable,并且返回一个一个数字(表示“时间”,任意单位)。如果ti
2015-06-24 12:32:05 4617
原创 Python多线程1:threading
threading模块提供了高级别的线程接口,基于低级别的_thread模块实现。模块基本方法该模块定了的方法如下:threading.active_count() 返回当前活跃的Thread对象数量。返回值和通过enumerate()返回的列表长度是相等的。threading.current_thread() 返回当前线程对象,对应调用者的
2015-06-23 15:13:22 6203 1
原创 Python正则表达式:如何使用正则表达式
正则表达式(简称RE)本质上可以看作一个小的、高度专业化的编程语言,在Python中可以通过re模块使用它。使用正则表达式,你需要为想要匹配的字符串集合指定一套规则,字符串集合可以包含英文句子、e-mail地址、TeX命令或者其它任何你希望的字符串。然后您能提这样的问题:“这个字符串匹配这个模式吗?”,或者“在这个字符串中存在这个模式的匹配吗?”。你也能使用正则表达式修改一个字符串或者分离它。
2015-06-08 18:22:55 8096 1
hadoop-part3
2015-08-04
hadoop-part2
2015-08-04
hadoop-part1
2015-08-04
linux教学课件:Advanced Programming in the Linux Environment
2009-11-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人