I have a couple of questions on what to do when I want to run multiple threads at the same time...
1.) Can I use the same created semaphore for of the threads running at the same time?
Code:
CreateSemaphore(NULL, 4, 4, THREAD_SEMAPHORE);
2.) Can I use the same lpThreadId, or should I use different pointers?
Code:
HANDLE CreateThread(
LPSECURITY_ATTRIBUTES lpThreadAttributes, // pointer to security attributes
DWORD dwStackSize, // initial thread stack size
LPTHREAD_START_ROUTINE lpStartAddress, // pointer to thread function
LPVOID lpParameter, // argument for new thread
DWORD dwCreationFlags, // creation flags
LPDWORD lpThreadId // pointer to receive thread ID
);
Thank you.