Michael Wei

Results 4 issues of Michael Wei

3.1 版去除了2.9 版本的Scheduler::Run , 仅留下了类似Scheduler::Runloop 类似功能的 Scheduler::Start / goStart, 也就是只保留了协程调度循环,摒弃了单次协程调度。这会为一些原先基于2.9的应用迁移到3.1 带了难题: 比如我同时使用libgo和另外一个库B,库B也使用了类似的任务调度循环,则这个库B就没有可能和libgo一起用了。 库B的调度循环: while(true){ run_tasks(); if(this->onEventCycle) this->onEventCycle(); } 原先我可以在 onEventCycle() 回调中调用 libgo 的Scheduler::Run(), 现在去掉了Scheduler::Run(), 这个功能就不能实现了。 最近准备迁移phpgo到最新libgo,发现了这个问题,因而讨论一下。盼复。

"TLS or non-reentrant library functions that depend on TLS implementation should be avoided as far as possible. " as far as -> as long as (只要)

与gethostbyname/gethostbyaddr 一样, getaddrinfo也有共用socket问题, 过个协程同时调用getaddrinfo会导致错误 ( 通常会触发FileDescriptorCtx::add_into_reactor 中 assert(false) )。 以下代码可以解决问题,我在一个较老版本libgo上使用正常。若果没有意见的话,我整理一下提交pr? @yyzybb537 int getaddrinfo(const char *__restrict host, const char *__restrict service, const struct addrinfo *__restrict hint, struct addrinfo **__restrict res) {...