Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

简单修改增加多线程的可能性 #1395

Closed
cesaryuan opened this issue Feb 20, 2021 · 6 comments
Closed

简单修改增加多线程的可能性 #1395

cesaryuan opened this issue Feb 20, 2021 · 6 comments
Labels

Comments

@cesaryuan
Copy link

image

@cuiliang
Copy link
Owner

好的

@cuiliang
Copy link
Owner

搞到一半,发现这个问题比想象的复杂。
虽然等待可以超时,或者WaitAny只等待一个,但是其他进行中的任务并不会自动取消。它们仍然会继续运行,并且可能在后面的步骤里去更改变量内容,造成一定程度的混乱和不可预知性。

@cesaryuan
Copy link
Author

搞到一半,发现这个问题比想象的复杂。
虽然等待可以超时,或者WaitAny只等待一个,但是其他进行中的任务并不会自动取消。它们仍然会继续运行,并且可能在后面的步骤里去更改变量内容,造成一定程度的混乱和不可预知性。

其他任务不会自动停止吗?那有点难搞哦

@cesaryuan
Copy link
Author

@cuiliang 好像可以通过 CancellationTokenSource 来停止任务

@cuiliang
Copy link
Owner

@cuiliang 好像可以通过 CancellationTokenSource 来停止任务

嗯,不过这个改动有点大,非常多的地方都要处理,包括模块里的,等再考察一下

@cuiliang
Copy link
Owner

关闭古老issue中,感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants