multithreading - Can I limit the I/O of my C# app -
I created an app that works on thousands of files, then writes revised copies of these files on the disk. I am using Threadpool, but it was creating multiple threads, which was not responding to PC 26 fees), so I changed the default of 50 to 50, it resolved that problem (app only approx. 60 spans about the thread), although now the files So getting ready soon, so the PC where the UI is being elevated is unresponsive.
Is there any way to limit the amount of I / O - I mean, to work on 50 threads, but write 50 threads at the same time while writing. I will not do the architect instead of writing files if I can save it - I was hoping that I can limit the amount of I / O (together) to these pool threads.
Use a semaphore to make no limit
Limits the number of threads that can access pools of resources or resources simultaneously.
Comments
Post a Comment