我明白在Parallel.ForEach中使用iterator ++不是一個好的選擇,但現在我不得不在Parallel.ForEach循環中使用一個計數器,counter用來選取一個列名任何建議什麼是最好的選擇?我在StackOverflow的某處讀到使用「Interlocked」再次是Parallel.ForEach中的糟糕設計。Counter ++ in Parallel.ForEach
3
A
回答
1
相關問題
- 1. Parallel.ForEach in c#4
- 2. Parallel.ForEach in .NET 4.0
- 3. Python Counter Counter and subtract
- 4. Parallel.ForEach和Aggregate異常
- 5. Javascript word counter counter問題
- 6. counter ++/counter--按預期工作
- 7. Python GC Counter - Rosalind
- 8. counter enumerateObjectsUsingBlock
- 9. word counter || python
- 10. PowerShell Get-Counter命令,-ComputerName與-Counter
- 11. 與Parallel.ForEach
- 12. Ease out Counter
- 13. Qualtrics Word Counter Javascript
- 14. HTML5 canvas drop counter
- 15. jQuery Counter Not Working
- 16. jQuery Counter Closure
- 17. SQL Counter幫助
- 18. CSS counter-reset
- 19. React Nat Counter
- 20. Click counter php mysql?
- 21. PHP hit counter issue
- 22. redis batsd(statsd)counter
- 23. IE counter-progress(CSS)
- 24. Performance-Billion Counter
- 25. Firebase like counter
- 26. Php like counter
- 27. php - webpage visted counter
- 28. Touchstart,touchend javascript counter
- 29. jquery counter/uncounter function
- 30. Jquery animated percentage counter
你能提供一些關於你爲什麼需要櫃檯的更多細節嗎?如果您只是遍歷動態對象的列,除非您期望大量的列,我認爲並行化可能不是最好的方法。 – 2010-08-10 12:32:10
你是對的Ryan,但我只是想試試我的運氣,如果我可以利用Parallel.ForEach。我覺得唯一的塊是計數器,否則「任務」是乾淨的,並且不依賴於其他對象。 – Princeton 2010-08-10 12:47:54