加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – WPF调度程序BeginInvoke订购保证

发布时间:2020-12-15 17:43:29 所属栏目:百科 来源:网络整理
导读:如果我打电话 Dispatcher.BeginInvoke(operation,DispatcherPriority.Loaded) 来自20多个线程的1,000,000次,这些1,000次操作是否按照BeginInvoke调用的顺序由UI线程执行? 解决方法 msdn说 If multiple BeginInvoke calls are made at the same DispatcherPr
如果我打电话
Dispatcher.BeginInvoke(operation,DispatcherPriority.Loaded)

来自20多个线程的1,000,000次,这些1,000次操作是否按照BeginInvoke调用的顺序由UI线程执行?

解决方法

msdn说 If multiple BeginInvoke calls are made at the same DispatcherPriority,they will be executed in the order the calls were made

但是如果您从多线程Any instance members are not guaranteed to be thread safe.访问调度程序

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读