I want to run one function with different parameters on different threads:
int threads = 3;
int par1[] = {1, 2, 3};
int par2[] = {4, 5, 6};
for (int i=0; i&l
You create a thread in Windows by calling CreateThread. There's an example here.
Yes, you can dynamically create threads.
Now, when your "thread function" is getting called (which means the thread started) you use the passed parameter which you've feeded when calling CreateThread.
At the "thread-function" it's "LPVOID lpParam". You should cast it to your type. If it's two objects you need to pass to the thread then create your own custom struct/class with the appropriate memebers, and pass an instance of it when calling CreateThread so you can use it later. Very straight-forward.