后台工作者进程 [英] Background worker process

查看:74
本文介绍了后台工作者进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


您能否请我参考一篇文章,以了解如何在应用程序中使用几个后台工作进程?
我看到的所有样本都仅在其应用程序中使用一个.
感谢

Hi,
Can you please refer me to an article where I can see how SEVERAL background worker processes can be used in an application?
All the samples I see, are using just the one in their application.
Thanks

推荐答案

基本上使用多个backgound工人应该就像使用一个.

实例化多个工作程序,为其关联电线事件处理程序等.如果需要,您可以为每个工作程序使用不同的事件处理程序,或根据事件中的sender参数在同一事件处理程序中区分这些工作程序.
Basically using several backrgound workers should be like using one.

Instantiate multiple workers, wire event handlers for them etc. If you want you can use different event handlers for each worker or distinguish the workers in same event handler based on the sender parameter in the event.


后台工作者运行一个单独的线程,而不是一个进程;因此,找不到所需的代码.此外,你的想法是错误的.并行运行一个以上的后台工作者没有什么特别的.您无法用自己的方法学到任何新东西.

—SA
A background worker runs a separate thread, not a process; therefore, the code you want cannot be found. Besides, your idea is wrong; there is nothing special in running more than one background worker in parallel. You cannot learn anything new using your approach.

—SA


这篇关于后台工作者进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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