2016-02-05 ruki
New features Add automaticlly check libc interfaces Support custom allocator Add trace for allocator in the debug mode Add static_pool module Add stream interfaces for reading all data to string Add adler32 hash algorithm Add tb_memmem interface Add regex module with pcre, pcre2 or posix regex Changes Optimize stre 继续阅读 »
2016-02-25 ruki
新特性 增加smallest参数配置选项,实现一键配置最小化编译,禁用所有扩展模块和依赖库 增加进程创建和控制接口 改进 增强环境变量设置接口 修改xmake.lua支持最新版xmake v2.x, 简化编译配置 Bugs修复 修复ltimer定时器不准问题 修复asio部分内存泄露问题 修复asio/httpd在linux下keepalive模式,响应很慢问题 修复windows下路径处理的一些bug 继续阅读 »
2016-02-25 ruki
New features Add smallest configure option Add process operation interfaces Changes Improve envirnoment interfaces Modify xmake.lua for supporting xmake v2.x Bugs fixed Fix ltimer bug Fix asio memory leaks bug Fix asio httpd response bug on linux Fix path bug for windows 继续阅读 »
2016-08-29 ruki
新特性 增加同时等待多个进程接口 增加uuid生成器 增加hash库模块 添加__tb_deprecated__关键字以及配置选项 改进 移动部分utils接口到hash模块 重写random生成器 Bugs修复 修复stdout在vs2015以上版本的兼容性问题 修复进程参数长度限制 继续阅读 »
2016-08-29 ruki
New features Add wait multi-processes interface Add uuid generator Add hash library module Add __tb_deprecated__ keyword and option Changes Move some utils interfaces to the hash module Rewrite random generator Bugs fixed Fix stdout compatibility issue for vs2015 Fix process arguments length limit 继续阅读 »
2016-10-30 ruki
New features Support make command and compile directly without xmake Add switch context interfaces into platform module Add coroutine module (supports i386, x86_64, arm, arm64 ..) Add simple http server demo using coroutine Add simple spider using coroutine Add io poller interfaces(with epoll, poll, kqueue, select) Su 继续阅读 »
2016-12-07 ruki
Stackless introduction Stackfull introduction More coroutine examples New features Support coroutine context switch for mips Add __tb_thread_local__ keyword macro Add --micro=y|n option to compiling micro library (~64K) for the embed system Add tb_addrinfo_addr and tb_addrinfo_name interfaces Add stackless coroutine A 继续阅读 »
2017-08-30 ruki
New features Add ping demo for network Changes Modify license to Apache License 2.0 Rename --smallest=y|n option to --small=y|n Support stat64 Improve copy speed and fix permissions for tb_file_copy Improve path operation for posix platform Improve socket interfaces and support icmp Improve xmake.lua and remove binar 继续阅读 »
2016-11-13 ruki
在分析了各大开源协程库实现后,最终选择参考boost.context的汇编实现,来写tbox的切换内核。 在这过程中,我对boost各个架构平台下的context切换,都进行了分析和测试。 在macosx i386和mips平台上实现协程切换时,发现boost那套汇编实现是有问题的,如果放到tbox切换demo上运行,会直接挂掉。 在分析这两个架构上,boost.context切换实现问题,这边先贴下tbox上的context切换demo,方便之后的讲解: 继续阅读 »
2016-02-04 ruki
TBOX的线程池通过在每个worker中批量一次拉取多个task,对锁的竞争进行了优化。 由于每个task的函数实现不会太多,所以可以根据每个task的函数地址做hash,统计出每个task执行所花费的平均时间。然后根据这个平均值来动态计算每个worker一次拉取的task的数量,TBOX里面默认每个worker一次拉取10s的task量,这样可以尽可能的避免worker间锁的频繁抢占。 所有从等待队列被拉取出来的task,都会被放到pending队列中去,如果等待队列中的task都被取完了,某个worker处于了空闲状态,就会尝试去pending中,重新拉取其他worker还没有执行到的task, 这样可以解决某些task耗时 继续阅读 »