gpt4 book ai didi

c# - C# 中的线程。可中断任务

转载 作者:太空狗 更新时间:2023-10-29 22:35:20 25 4
gpt4 key购买 nike

在我的程序中,我有一些非常长的任务,应该可以从 GUI (WPF) 中断。关于线程架构有什么建议吗?

这个任务看起来像 N 线程有这样的代码:

public void DoLongOperation()
{
for(int i=beginPoint; i<endPoint; i++)
{
doSomethingStupid(dataArray[i]);
}
}

最佳答案

关于c# - C# 中的线程。可中断任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1258642/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com