TaskPool任务项同步运行 [英] TaskPool task items running synchronously

查看:62
本文介绍了TaskPool任务项同步运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在RxUI(http://www.reactiveui.net)中有一个错误,似乎Observable.Start(()=> someFunc(),Scheduler.TaskPool)最终同步运行 - 任务只是在UI线程中运行。 


https://github.com/xpaulbettsx/ReactiveUI/issues/30


任何想法为什么使用TaskPool最终仍会在同一个线程上运行?

解决方案

嗨Paul,


<我刚刚单独测试了这段代码(在一个新的WPF应用程序中);


Observable.Start(()=> someFunc(),Scheduler.TaskPool)


它工作正常...


你能提供一个工作的"片段"吗?演示这个问题? 


I have a bug in RxUI (http://www.reactiveui.net), where it seems that Observable.Start(() => someFunc(), Scheduler.TaskPool), ends up running synchronously - the task simply runs in the UI thread. 

https://github.com/xpaulbettsx/ReactiveUI/issues/30

Any ideas why using TaskPool would end up still running on the same thread?

解决方案

Hi Paul,

I've just tested this code in isolation (in a new WPF application);

Observable.Start(() => someFunc(), Scheduler.TaskPool)

It works fine...

Can you provide a working "snippet" that demos this problem? 


这篇关于TaskPool任务项同步运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆