Как точно AsParallel работает?

Вы посмотрели ЖЕНА ? Мы используем это в нашем приложении, которое переводит сообщения SWIFT во внутренний формат XML и назад снова. У нас не было проблем с ним. Кроме того, это лицензируется под LGPL, таким образом, можно изрубить его, если Вы должны. Проверьте его.

7
задан ripper234 28 November 2009 в 14:25
поделиться

2 ответа

Task Parallel Library cares about the static type of the sequence. It should be IParallelEnumerable for the operations to be handled by the TPL. You are casting the collection back to IEnumerable when you call Test. Therefore, the compiler will resolve .Where call on the sequence to System.Linq.Enumerable.Where extension method instead of the parallel version provided by the TPL.

24
ответ дан 6 December 2019 в 05:55
поделиться

As Parallel works by putting your stuff into the ThreadPool. Also, how many cores do you have? If you're working on a single core machine that will still take about 4s to run.

2
ответ дан 6 December 2019 в 05:55
поделиться
Другие вопросы по тегам:

Похожие вопросы: