上一页 1 2 3 4 5 6 7 8 ··· 11 下一页
摘要: 恢复内容开始 mysql不区分大小,但默认用大写 sql语句以;结尾 单行注释-- 多行注释/**/ 数据库的基本操作 创建数据库 creat database [if not exists] doudou [character set xx]; 查看所有数据库 show databases; 删除 阅读全文
posted @ 2018-05-28 15:09 阜阳小全 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 父节点属性 parentnode 父节点标签元素 parentElement 所有子标签 children 第一个子标签firstElementcChild 最后一个子标签lastElementChild 下一个兄弟标签 nextElementSibling 上一个兄弟标签previousEleme 阅读全文
posted @ 2018-05-21 12:50 阜阳小全 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 恢复内容开始 事件驱动编程思想: 一种编程范式 阻塞IO:只发了一次系统调用 触发方式: 1 水平触发 select属于水平触发 2 边缘触发 3 IO多路复用 同时可以监听多个。单线程下实现并发 select poll epoll 异步 IO 最大的特点,全程无阻塞 恢复内容结束 阅读全文
posted @ 2018-05-09 17:35 阜阳小全 阅读(66) 评论(0) 推荐(0) 编辑
摘要: import time from multiprocessing import Process,Pool def Foo(i): time.sleep(1) print(i) def Bar(arg): print('hello') if __name__ == '__main__': pool = Pool(5) #进程池的容量是5 for i... 阅读全文
posted @ 2018-05-07 15:01 阜阳小全 阅读(86) 评论(0) 推荐(0) 编辑
摘要: import time,random import queue,threading q = queue.Queue() def Producer(name): count = 0 while count < 10: print('making-------------') time.sleep(random.randrange(3)) ... 阅读全文
posted @ 2018-05-07 07:34 阜阳小全 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 先进先出模式 先进后出模式 优先级模式 阅读全文
posted @ 2018-05-04 18:38 阜阳小全 阅读(112) 评论(0) 推荐(0) 编辑
摘要: import time,threading class MyThread(threading.Thread): def run(self): if semaphore.acquire(): print(self.name) time.sleep(1) semaphore.release() if ... 阅读全文
posted @ 2018-05-04 17:56 阜阳小全 阅读(91) 评论(0) 推荐(0) 编辑
摘要: ''' event.wait() #设定阻塞,此时线程会被阻塞,等遇到event.set()时,线程会继续运行 event.set() event.clear() # ''' import time,threading class Boss(threading.Thread): def run(self): print('Boss:','今晚加班到10点') ... 阅读全文
posted @ 2018-05-04 17:45 阜阳小全 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 一种情况,会造成死锁,,代码如下 用递归锁,可以避免死锁。代码如下 阅读全文
posted @ 2018-05-04 14:49 阜阳小全 阅读(119) 评论(0) 推荐(0) 编辑
摘要: ''' GIL:全局解释锁 因为有GIL,所以,同一时刻,只有一个线程被cpu执行 处理方法:多进程+协程 任务种类:IO密集型 计算密集型 对于IO密集型的任务,Python的多线程时有意义的 可以采用多进程+协程 对计算密集型的任务,Python的多线程就不推荐,Python就不适用了 ''' # 同步锁 import threading i... 阅读全文
posted @ 2018-05-04 14:40 阜阳小全 阅读(92) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 11 下一页