Results 18 comments of James

@janvanbesien hi,janvanbesien. I've noticed that your project is not very well maintained. i used it in our system,do you need a maintaner to help you handle the issue and review...

@lemire in gson(write by google),there is a class named "com.google.gson.stream.JsonReader". it has some basic function for json like peek,beginArray,endArray,beginObject,endObject,hasNext and so on. i overwrite this class,and use similar function in...

1.if it is your file path is to long to exceed the system limit 2.you'd better upload your zip file for reproduce the problem

i will take a try. i have taken a look at the rar5.0 format, it changes a lot.i will try my best,but i wont be finished soon。

> > i have taken a look at the rar5.0 format, it changes a lot.i will try my best,but i wont be finished soon。 > > The kaitai tool mentioned...

@gotson I've read that document,the rar v5 format is not yet implemented。

这个协程库跟java的线程池(ExecutorService)很像,就是只管提交要处理的任务,任务调度由框架来处理,维护一个任务队列,线程死循环去队列中获取任务进行处理。 有差异的地方是,这个库实现了一些原语,能让任务自己切换出去后,任务所在的线程能够处理其他任务;java的线程池没办法实现这一点,因为java目前没有机制能够保存上下文,让切除去的任务下次执行的时候,能够恢复现场,所以java处理一个任务的时候,任务必须处理完(函数返回),才能去调度其他任务。 任务里面的代码如果阻塞了,该条线程就会被阻塞,那样会失去设计协程的意义,退化成了线程池。所以作者对所有阻塞操作,单独设计了一套api,来防止这种退化。 个人认为这个库的协程,只是在多线程的基础上,模拟出了协程的特点,就像linux中的线程是在进程基础上模拟出来的。 @dreamyphone 协程一方面,利用多核提高并发性,来提高软件性能(非系统性能,CPU硬件资源是死的,只能提高利用率) 如果不利用多核的话,协程仅仅只是帮助你减少调度任务的代码而已。你的测试代码,只使用了单线程,对比直接跑这个函数,多了调度的开销,肯定会变慢呀。 @yyzybb537 我是加你qq的那位,初步浏览了下你的大作。我有理解不对的地方,多谢批评指正。

你能把你完整的测试代码放上来吗,我运行你上面的测试代码,没出现你说的情况。只是死循环创建协程,把内存耗尽了

看一下void Scheduler::Start的代码最后一行mainProc->Process(); 这个方法是死循环去处理提交给它的协程。所以Start方法不会退出。 要想继续添加协程,只能将co_sched.Start() 放在其他线程中运行。 比如sample1中的std::thread t([]{ co_sched.Start(); }); 作者也封装成了co_sched.goStart()

1 不一定要安装boost库。是否要安装boost库,取决于你编译哪个测试用例,或者说取决于你需要用什么功能。 2 上面截图报错不是因为缺少boost库,而是因为下面三个脚本没有可执行权限,导致缺少*.S文件。给脚本加权限,重新执行即可。 libgo/third_party/select_asm.sh libgo/third_party/boost.context/bootstrap.sh libgo/third_party/boost.context/tools/build/src/engine/build.sh