Replies: 10 comments 6 replies
-
调用nnprofile.start(name)后没有调用nnprofile.stop(name)又调用了nnprofile.start(name) |
Beta Was this translation helpful? Give feedback.
-
我也是这么想的,但关键是怎么会出现这个情况的。我是在skynet.dispatch里调的start和stop,如果这之间因阻塞导致协和切换,那么在处理其他消息时,又会重复使用前一协程吗? |
Beta Was this translation helpful? Give feedback.
-
我简单看了skynet的协程池代码,按理这个任务未完成时,这个协程不会被回收用作其他代码执行,所以没明白发生的原因。 |
Beta Was this translation helpful? Give feedback.
-
我把这个出错的协程日志专门抽取出来了,感觉不正常,就算start和stop之间有阻塞调用,但此任务未完成,这个协程不应该被作干别的事了。
|
Beta Was this translation helpful? Give feedback.
-
或者是不是可以理解为,在skynet.dispatch注册的消息处理函数中,如果有阻塞调用,那么就不能使用profile的start和stop来统计执行时间了? |
Beta Was this translation helpful? Give feedback.
-
应该是在阻塞时被不同协程重复调用了start,而没有传入当前协程参数导致 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
skynet wiki(https://github.com/cloudwu/skynet/wiki/Profile)上说:
那我想问的是,profile和os.clock的区别是什么? |
Beta Was this translation helpful? Give feedback.
-
业务中有什么情况会导致 dispatch不在skynet线程中调用吗? |
Beta Was this translation helpful? Give feedback.
-
我这边测试下来profile.start好像不太好用,虽然传入skynet.coroutine.thread()可以解决不同协程间冲突问题,但在用作客户端压测代码按socket分组而非协程分组时,就没法用了。 |
Beta Was this translation helpful? Give feedback.
-
我这边在函数开始和结束时分别调用了profile.start()和profile.stop(),但偶发性会报以下错误,是否因为该函数调用中涉及到skynet.timer引发了协程切换导致?
profile.lua:60: Thread 0x7d7ca7c499a8 start profile more than once
Beta Was this translation helpful? Give feedback.
All reactions