Ok, here\'s the situation: My main/UI thread (call it Thread1) is used for acquiring a batch of images from a phsycial document scanner. When a batch has been acquired, a se
Is there a way to "limit" a Parallel.For loop so that it does not max out my processors?
Yes, you can add an Options with MaxDegreeOfParallelism=N.
Or to set the processing priority?
No. It is a ThreadPool (borrowed) thread. Don't change its properties. Actually it's a bunch of pool threads.
Or am I misunderstanding how a Parallel.For loop works? Is it blocking Thread1 somehow?
Yes, from the outside Parallel.For(...)
is a blocking call. So run it on a separate Task or Backgroundworker, not from the main thread.