xhawk18

Results 47 comments of xhawk18

这个项目和libuv不是替代关系。 它使用libuv时,也是对libuv的包装,目的是用直白的顺序逻辑,改造原来难写的回调逻辑。 例子:https://github.com/xhawk18/s_task/blob/master/examples/ex3_http_client.c 和libuv一样,建议一个uvloop只应用于一个线程。 如果要发挥多核优势,根据cpu核心线程数,多起几个uvloop就可以了。

补充一下,这个问题是因为 ”接收任务“ 设置 g_closed = true 先退出了, 如果 ”发送任务“ 的队列已满,并且系统也没有更多的任务在运行中(或sleep中任务的情况下), 队列不可能被消费了,这时有三种处理方式 --- 1. 发送任务一直等着 2. 发送任务直接取消 3. 发送任务的发送函数返回失败 方式3比较合理,然而目前代码选的方式2,只要保障chan中的消息有人收就没问题。

更新了,没有其他任务可以唤醒时,s_chan_put返回失败,输出如下 ``` put 1 put 2 put 3 put 4 put 5 put 6 put 7 get 1 done. done. done. done. cancelled at line 55 done. cancelled at line...

笔误,这么算多分配了。已提交修正 thank you!

1. ucontext.h or fibers were removed. Promise-cpp would be a pure library that supports to implement promisified tasks, that means, it has no fiber or event loop, but can be...

thank you, It seems like a bug, i'll check it soon!

hi, i send a patch [here](https://github.com/xhawk18/promise-cpp/commit/21feb7e9586fb065e2ead52b4685eb574bc7f570) that may fix this issue. btw, the testing code above may have dead-lock and we need set larger thread pool size other than 10....

和js差不多,all 返回的Defer对象调用 then,参数是个 std::vector 数组。 pm_any可以包含任意类型的对象。