03 2020 档案

摘要:ThreadPoolExecutor ProcessPoolExecutor: 从Python3.2开始,标准库为我们提供了 concurrent.futures 模块,它提供了 ThreadPoolExecutor (线程池)和ProcessPoolExecutor (进程池)两个类。 相比 th 阅读全文
posted @ 2020-03-31 17:43 burlingame 阅读(235) 评论(0) 推荐(0) 编辑
摘要:1,删除包含pattern的某一行 :g/pattern/d 或 :%g/pattern/d 2,删除不包含pattern的某一行 :v/pattern/d 或 :g!/pattern/d 3,替换 #vi/vim 中可以使用 :s 命令来替换字符串 :s/vivian/sky/ # 替换当前行第一 阅读全文
posted @ 2020-03-31 10:21 burlingame 阅读(381) 评论(0) 推荐(0) 编辑
摘要:转载:https://www.cnblogs.com/whatisfantasy/p/6440585.html 1 概念梳理: 1.1 线程 1.1.1 什么是线程 线程是操作系统能够进行运算调度的最小单位。它被包含在进程之中,是进程中的实际运作单位。一条线程指的是进程中一个单一顺序的控制流,一个进 阅读全文
posted @ 2020-03-30 12:03 burlingame 阅读(245) 评论(0) 推荐(0) 编辑
摘要:1,几个概念: GIL: Global Interpreter Lock,全局解释器锁。为了解决多线程之间数据完整性和状态同步的问题,设计为在任意时刻只有一个线程在解释器中运行。 线程:程序执行的最小单位。 进程:系统资源分配的最小单位。 线程安全:多线程环境中,共享数据同一时间只能有一个线程来操作 阅读全文
posted @ 2020-03-27 20:38 burlingame 阅读(211) 评论(0) 推荐(0) 编辑
摘要:转载:https://blog.csdn.net/just_kong/article/details/99289539 1、原子操作原子操作(atomic operation)指的是由多步操作组成的一个操作。如果该操作不能原子地执行,则要么执行完所有步骤,要么一步也不执行,不可能只执行所有步骤的一个 阅读全文
posted @ 2020-03-26 22:18 burlingame 阅读(240) 评论(0) 推荐(0) 编辑
摘要:vthread中包含两个类: vthread.vthread.pool vthread.vthread.thread 其中class pool的原型如下: class pool(builtins.object) pool(pool_num=None, gqueue=0, join=False, lo 阅读全文
posted @ 2020-03-26 18:53 burlingame 阅读(841) 评论(0) 推荐(0) 编辑
摘要:转载:https://www.cnblogs.com/klb561/p/9271322.html 1 python的安装 首先,从python的官方网站 www.python.org下载需要的python版本,地址是这个: http://www.python.org/ftp/python/2.7.6 阅读全文
posted @ 2020-03-25 17:35 burlingame 阅读(3197) 评论(0) 推荐(0) 编辑
摘要:转载:https://www.linuxidc.com/Linux/2019-03/157819.htm 在Linux的top和ps命令中,默认看到最多的是pid (process ID),也许你也能看到lwp (thread ID)和tgid (thread group ID for the th 阅读全文
posted @ 2020-03-25 16:10 burlingame 阅读(1386) 评论(0) 推荐(1) 编辑
该文被密码保护。
posted @ 2020-03-25 15:56 burlingame 阅读(0) 评论(0) 推荐(0) 编辑
摘要:转载: https://mp.weixin.qq.com/s?__biz=MzU4NzU0MDIzOQ==&mid=2247487782&idx=3&sn=3f04bb053d01fa37ad1fdce54b2572c7&scene=21#wechat_redirect CPU(Central Pr 阅读全文
posted @ 2020-03-24 17:36 burlingame 阅读(598) 评论(0) 推荐(0) 编辑
摘要:管道的特点:如果管道中没有数据,那么取管道数据的操作就会滞留,直到管道内进入数据,然后读出后才会终止这一操作;同理,写入管道的操作如果没有读取管道的操作,这一动作也会滞留。 1,匿名管道 匿名管道使用符号 | 表示,管道的两端时两个普通的,匿名的,打开的文件描述符:一端只读和一端只写。 cat fi 阅读全文
posted @ 2020-03-19 15:35 burlingame 阅读(1480) 评论(0) 推荐(0) 编辑
摘要:I/O重定向 默认情况下,有3个“文件”处于打开状态,stdin,stdout,stderr;重定向的解释:捕捉一个文件,命令,程序,脚本或者脚本中的代码块的输出,然后将这些输出作为输入发送到另一个文件,命令,程序或者脚本中。 每个打开的文件都会被分配一个文件描述符,stdin,stdout,std 阅读全文
posted @ 2020-03-19 11:17 burlingame 阅读(233) 评论(0) 推荐(0) 编辑
摘要:http://mywiki.wooledge.org/SignalTrap Signals are a basic tool for asynchronous interprocess communication. What that means is one process (A) can tel 阅读全文
posted @ 2020-03-18 15:44 burlingame 阅读(213) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2020-03-18 12:18 burlingame 阅读(7) 评论(0) 推荐(0) 编辑
摘要:exec和source都属于bash内部命令(builtins commands),在bash下输入man exec或man source可以查看所有的内部命令信息。 bash shell的命令分为两类:外部命令和内部命令。外部命令是通过系统调用或独立的程序实现的,如sed、awk等等。内部命令是由 阅读全文
posted @ 2020-03-16 17:24 burlingame 阅读(2635) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2020-03-16 17:02 burlingame 阅读(2) 评论(0) 推荐(0) 编辑
摘要:《高级Bash脚本编程指南》Revision 10中文版 github上链接地址: https://github.com/LinuxStory/Advanced-Bash-Scripting-Guide-in-Chinese 在线阅读链接:http://www.linuxplus.org/kb/ g 阅读全文
posted @ 2020-03-15 10:36 burlingame 阅读(201) 评论(0) 推荐(0) 编辑
摘要:首先我要吐槽一下,看程序的过程中遇见了yield这个关键字,然后百度的时候,发现没有一个能简单的让我懂的,讲起来真TM的都是头头是道,什么参数,什么传递的,还口口声声说自己的教程是最简单的,最浅显易懂的,我就想问没有有考虑过读者的感受。 接下来是正题: 首先,如果你还没有对yield有个初步分认识, 阅读全文
posted @ 2020-03-13 17:33 burlingame 阅读(253) 评论(0) 推荐(0) 编辑
摘要:在python3中 print(range(10))range(0,10) 得出的结果是 range(0,10) ,而不是[0,1,2,3,4,5,6,7,8,9] ,为什么呢?而且原来Python2版本中的xrange也已经取消。官网原话:In many ways the object retur 阅读全文
posted @ 2020-03-13 17:30 burlingame 阅读(657) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2020-03-13 15:31 burlingame 阅读(0) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示