上一页 1 2 3 4 5 6 7 8 9 ··· 17 下一页
摘要: #!/usr/bin/env python# -*- coding: utf-8 -*-from threading import Threadfrom Queue import Queueimport timeclass Producer(Thread): def __init__(self,na 阅读全文
posted @ 2017-09-24 15:14 泽锦 阅读(469) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python# -*- coding: utf-8 -*-import threadingimport timedef customer(cond): t = threading.currentThread() with cond: # wait()方法创建了一个名为w 阅读全文
posted @ 2017-09-24 11:23 泽锦 阅读(638) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python# -*- coding: utf-8 -*-import threadingimport timevalue = 0lock = threading.Lock()def add(): global value with lock: new_value = 阅读全文
posted @ 2017-09-24 10:59 泽锦 阅读(346) 评论(0) 推荐(0) 编辑
摘要: 输出: python t_Semaphore.py 0 acquire sema1 acquire sema2 acquire sema 1 releas sema2 releas sema0 releas sema3 acquire sema4 acquire sema4 releas sema  阅读全文
posted @ 2017-09-24 10:40 泽锦 阅读(738) 评论(0) 推荐(0) 编辑
摘要: 只有当一个query执行时间(不包括锁等待的时间)>long_query_time的时候,才会判定会slow log; 但是判定为slow log之后,输出包括Query_time(执行时间+锁等待时间),并且也会输出Lock_time时间。 所以Query_time并不是说语句真正执行的时间,而是 阅读全文
posted @ 2017-08-17 20:46 泽锦 阅读(1240) 评论(0) 推荐(0) 编辑
摘要: 得设置:binlog_rows_query_log_events=1 阅读全文
posted @ 2017-08-17 19:57 泽锦 阅读(737) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-07-21 10:51 泽锦 阅读(325) 评论(0) 推荐(0) 编辑
摘要: channel初步认识: package main import "fmt" import "time" func main() { c := make(chan int) //初始化一个管道 defer close(c) //在main函数执行完毕之后执行。 go func() { //会开启一个 阅读全文
posted @ 2017-07-14 11:55 泽锦 阅读(694) 评论(0) 推荐(0) 编辑
摘要: 先安装包依赖: 安装vm tool 按提示操作即可。 有/mnt/hgfs但没有共享文件的解决方法: 这时不能用mount工具挂载,而是得用vmhgfs-fuse,需要安装工具包 此时进入/mnt/hgfs就能看到你设置的共享文件夹了。 阅读全文
posted @ 2017-07-10 10:16 泽锦 阅读(16009) 评论(5) 推荐(6) 编辑
摘要: 练习:错误 从先前的练习中复制 Sqrt 函数,并修改使其返回 error 值。 由于不支持复数,当 Sqrt 接收到一个负数时,应当返回一个非 nil 的错误值。 创建一个新类型 type ErrNegativeSqrt float64 为其实现 func (e ErrNegativeSqrt) 阅读全文
posted @ 2017-07-09 17:19 泽锦 阅读(1477) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 17 下一页