后台工人问题

编程入门 行业动态 更新时间:2024-10-12 01:24:14
本文介绍了后台工人问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

对不起,我想重新发布.已经发布了同一期.是WPF的新功能. 我们正在开发下载管理器.当网络断开时会自动找到下载管理器.然后暂时暂停.然后建立连接后将下载. (网络检测方法位于计时器内部,因此它将每秒检查一次.) 互联网连接打开后,暂停和恢复功能就可以正常工作了. 我的问题是 1)首先我尝试下载时进行网络检测方法检查.然后它在网络断开期间检测到net.so,我的backround worker线程停止了.所以在那之后我无法恢复. 2)然后我使用了另一种方法.在UI中发生进度受限事件期间.我正在检查网络检测方法.当我在此方法中使用时,由于每次检查网络时进度更改过程均不起作用.由于这个原因,我离开了. 3)第三种方法,断开互联网后我使用了文件层写程序.它也无法正常工作.

Hi, Sorry For Repost.Already Posted Same issue.Am new to WPF. We have developing Download manager.When net disconnect automatically found download manager.Then Pause it temporarily.Then After get connection It will download Will process.the above Same Procedure used in system shutdown too. (net detect method is placed inside the timer.so it will check every second.) Then Pause and resume is working properly when internet connection is on. My Issue is 1)First i tried net detect method checking while downloading.Then it detected net.so during net disconnect my backround worker thread stoped.so i cannot make Resume After That. 2)Then i used another method.during progress cahnged event in UI.I am checking net detect method.when i used in this method progress changing process is not working ..because every time it checked the net. due to that i leaved that. 3)Third method ,I used file straem writer after disconnect internet.it s also not working properly.

推荐答案

.NET 4.0具有内置的并行扩展名,该扩展名需要应对并行处理挑战.你可以试试看. .NET 4.0 has the built-in parallel extension which takes care of the parallel processing challenges. You can try that. IEnumerable<Int32> items = Enumerable.Range(0,20); Parallel.ForEach(items, (item) => ProcessLoop(item));

在网络中检查Parallel.For或Parallel.Foreach.

Check for Parallel.For or Parallel.Foreach in the web.

更多推荐

后台工人问题

本文发布于:2023-11-25 14:52:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630191.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:后台   工人

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!