任务LongRunning副作用吗?副作用、任务、LongRunning

由网友(四面楚歌我依旧淡定猖狂@)分享简介:如果使用的是LongRunning选项创建一个任务是否有任何副作用,因为它们不使用线程池If a Task is created using the LongRunning option are there any side effects as they do not use the ThreadPool推荐答案...

如果使用的是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.

阅读全文

相关推荐

最新文章