HANDLE used in C++
<p>I have a question regarding CreateMutex()</p>

<p>I am working on image data, and do certain calculations for different rotations of the image. I rotate the image in 180 steps (1° steps), and since these are independent from each other except writing the results back, I have decided to make this multi-threaded (very intensive calculations, and writing to memory takes up like no time of the execution).</p>

<p>I tried at first using a single mutex which allows a thread to write or not to write, but that decreased my performance a lot (got from 100% time with single thread, no mutex, to around 80% execution speed).</p>

<p>I have then created an array of HANDLE s, one per pixel (since its 656x480, its around 300k handles). This has improved my code to around 15% execution time (7 threads simultaneously).</p>

<p>Now when I watch this in the task manager, I see it has its own category called Handles, and this goes between 30k (with only some programs and OS running), and goes to 350k with my code running.</p>

<p>Is this behaviour okay, or is it bad and should be changed, if so, why, and how?</p>
