Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多线程处理workitem阻塞问题 #383

Open
higter opened this issue Jan 15, 2019 · 2 comments
Open

多线程处理workitem阻塞问题 #383

higter opened this issue Jan 15, 2019 · 2 comments

Comments

@higter
Copy link

higter commented Jan 15, 2019

批量使用AsyncLoader时,一次性推入workitem过多,会严重阻塞延迟。
需要动态根据workitem数量申请多线程处理。

@LiXizhi
Copy link
Owner

LiXizhi commented Jan 17, 2019

这个主要是IO问题, 和线程数量关系不是很大,目前已经是多线程。 建议用Loading条解决 (可以动态获得数量),或者做一些场景预加载,比如用摄影机将周围看一下, 但是前面用Loading条挡住,Paracraft里面有些玩家世界就是这样处理的。

如果希望增加线程数量, 可以修改引擎中的:

CAsyncLoader::GetSingleton().Start(2);

不过应该影响不大,因为硬盘和显卡只有一个。

@higter
Copy link
Author

higter commented Jan 17, 2019

image
与异步加载线程相关的数据,全部扩大到10倍。workitem队列处理速度会明显加快。扩展大到100倍,处理速度更快,但会降低FPS。这些参数,能不能根据cpu使用状况,做成动态的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants