DMPEngineTimer感觉设计的有问题。 #23
zhenghuawei-mobile
started this conversation in
General
Replies: 1 comment
-
单 app 实例不会有问题,未来有多实例 app 功能的时候,需要考虑到多线程的安全读写问题
测试了下执行顺序,没有发现问题,如果有 case 请告知
目前没有考虑这种实现 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
1、有线程安全的问题,比如
`
private static var timers = Int: Timer
private static var timerCounter = 0
这两个对象的操作
`
2、setTimeout这种实现可能不符合js规范。
比如如下代码执行顺序:
`
setTimeout((){
consoloe.log(11)
}, 0)
console.log(22)
`
个人认为,每个timer的回调需要在独立的线程执行。
Beta Was this translation helpful? Give feedback.
All reactions