上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页
摘要: int i=0; i++; printf("%d\n",i); 对于单CPU,开两个线程的话,如果不使用锁 最终的i可能不是2 对应的汇编是 1 movl $0 i(%rip) 2 movl i(%rip) %eax 3 addl $1 %eax 4 movl %eax i(%rip) 可见i++ 阅读全文
posted @ 2016-08-29 23:10 taek 阅读(298) 评论(0) 推荐(0) 编辑
摘要: php7的特点是规则上不从堆上分配内存,改为从栈上分配内存, 因为有些场景是从堆上分配内在后,还要手动释放内存,利用栈分配内在快的特点,在有需要的时候,再在堆上分配内在 但是栈上分配的内存,不能返回,因为当函数运行完后,就退栈了,但可以将该内在地址传给别的函数 php7的hashTable中的Buc 阅读全文
posted @ 2016-06-02 00:24 taek 阅读(2032) 评论(0) 推荐(0) 编辑
摘要: 在php5.3版本之前, php变量的回收机制只是简单的通过计数来处理(当refcount=0时,会回收内存),但这样会出现一个问题 $a=array("str"); $a[]=&$a; unset($a); 执行unset之前,$a的refcount 为2,执行unset之后,$a的refcout 阅读全文
posted @ 2016-05-09 07:28 taek 阅读(6120) 评论(1) 推荐(0) 编辑
摘要: protobuffer是google推出的一种数据传的方式,具体压缩,体积小的特点 protobuffer本身不支持php,若要把.proto文件转化为php支持的文件,需要使用第三方的程序 allegro/php-protobuf 或 drslump/Protobuf-PHP 参考 http:// 阅读全文
posted @ 2016-05-08 15:08 taek 阅读(13146) 评论(0) 推荐(0) 编辑
摘要: php变量的引用,如果使用的恰当,会带来效率的提升,相反,效率下降 count是个内置函数,参数只接收传值,但现在传入的参数$array是个引用,由于在php5中,某个值是不能引用变量和非引用变量之间使用, 针对这个例子来说,即在count内部,php引擎会copy一个$arrray指向的zval, 阅读全文
posted @ 2016-05-04 13:14 taek 阅读(278) 评论(0) 推荐(0) 编辑
摘要: HandlerSocket的优势和特点: 1) 支持多种查询模式 HandlerSocket目前支持索引查询(主键索引和非主键的普通索引均可),索引范围扫描,LIMIT子句,也即支持增加、删除、修改、查询完整功能,但还不支持无法使用任何索引的操作。另外支持execute_multi() 一次网络传输 阅读全文
posted @ 2016-03-06 17:14 taek 阅读(435) 评论(0) 推荐(0) 编辑
摘要: typedef struct st_key { uint key_length; /* Tot length of key */ ulong flags; /* dupp key and pack flags */ uint key_parts; /* How many ke... 阅读全文
posted @ 2016-02-25 15:11 taek 阅读(243) 评论(0) 推荐(0) 编辑
摘要: typedef struct keyuse_t { TABLE *table; Item *val; /** equality condition is on *cond_guard == FALSE equality condition is off NULL - Otherwise (the sourc... 阅读全文
posted @ 2016-02-25 15:06 taek 阅读(177) 评论(0) 推荐(0) 编辑
摘要: class JOIN :public Sql_alloc { JOIN(const JOIN &rhs); /** *fields; List group_fields, group_fields_cache; TABLE *tmp_table; /// used to store 2 possible tmp table ... 阅读全文
posted @ 2016-02-05 11:42 taek 阅读(188) 评论(0) 推荐(0) 编辑
摘要: typedef struct st_join_table { st_join_table() {} /* Remove gcc warning */ TABLE *table; KEYUSE *keyuse; /**select->quick. MySQL needs this i... 阅读全文
posted @ 2016-02-05 11:42 taek 阅读(236) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页