任务LongRunning副作用吗? [英] Task LongRunning side effects?

查看:283
本文介绍了任务LongRunning副作用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果使用的是LongRunning选项创建一个任务是否有任何副作用,因为它们不使用线程池

If a Task is created using the LongRunning option are there any side effects as they do not use the ThreadPool

推荐答案

。副作用是:如果你有一个亿的任务,你可能创造一百万线程

需要考虑到每个线程将携旗下的内存开销上下文切换开销。内存开销不小,我们所说的几MB 在这里,所以即使有上千项,你可能会遇到麻烦。

Need to take into account that each thread will bring its memory overhead and context switching overhead. Memory overhead is not that small, we are talking a few MB here so even with thousands of items, you could run into trouble.

这篇关于任务LongRunning副作用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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