>> HANDLE h[nr_threads] is not working because I need a constant value
You could use a vector<HANDLE>, allocate off the heap directly, or even allocate off the stack.

>> WaitForMultipleObjects(4,...