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

异步存储(Asynchronous storage) #1

Closed
nomiuo opened this issue Sep 27, 2021 · 2 comments
Closed

异步存储(Asynchronous storage) #1

nomiuo opened this issue Sep 27, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@nomiuo
Copy link
Owner

nomiuo commented Sep 27, 2021

异步存储尝试1: qt线程池

  • 由于Python有GIL全局解释器锁, 在qt的主线程中使用线程池只能够保证UI线程能够在大规模的时间操作响应UI, 但是该卡还是卡.
  • 同时还会有一些小bug, 应当用一个线程管理线程池, 才能起作用.
  • 在线程池操作时, 出现多线程写一个文件的情况,考虑用while True捕获异常, 尝试使用过互斥锁, 但是该锁会在io操作结束之前就释放, 也就是将io操作交给操作系统后即释放锁

异步存储尝试2: asyncio + aiofiles + quamash

通过quamash获得qt事件循环放入asyncio的事件循环, 也会出现多协程同时写的问题, 协程锁没有用. 同时在关闭程序后的前一秒save任务会被强制关闭, 协程状态为pending.

@nomiuo nomiuo created this issue from a note in 性能提升(performance improvement) (To Do) Sep 27, 2021
@nomiuo
Copy link
Owner Author

nomiuo commented Sep 27, 2021

通过最后的关闭窗口进行自动存储, 结合手动存储提高程序运行中的性能.

@nomiuo nomiuo closed this as completed Sep 27, 2021
@nomiuo nomiuo reopened this Oct 7, 2021
@nomiuo
Copy link
Owner Author

nomiuo commented Oct 7, 2021

Undo&&Redo only in current scene and the serialization must be asynchronous.

@nomiuo nomiuo added the enhancement New feature or request label Oct 7, 2021
@nomiuo nomiuo closed this as completed Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

1 participant