Possibly use the thread pool API?
EDIT: I'm not sure how you would use Job Objects for thread pooling. Per MSDN, they're used to manage a group of processes not threads.
For example, the following code has a parent and child process. The parent being the process that started notepad.exe. The child is notepad.exe. If a job object were NOT used in the following sample, terminating the parent (the process that started notepad.exe) via the task manager would NOT terminate the child, notepad.exe. So, a job object is used to manage both the parent and child process. Using a job object now terminates notepad.exe when the parent process is terminated via the task manager.
Code:
#define _WIN32_WINNT 0x0500
#include <windows.h>
int main(void)
{
HANDLE hJob;
JOBOBJECT_EXTENDED_LIMIT_INFORMATION jeli = { 0 };
PROCESS_INFORMATION pi = { 0 };
STARTUPINFO si = { 0 };
hJob = CreateJobObject(NULL, NULL);
jeli.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
SetInformationJobObject(hJob, JobObjectExtendedLimitInformation, &jeli, sizeof(jeli));
si.cb = sizeof(si);
CreateProcess( NULL, "notepad.exe", NULL, NULL, FALSE, CREATE_SUSPENDED,NULL, NULL, &si, &pi );
AssignProcessToJobObject(hJob, pi.hProcess);
ResumeThread(pi.hThread);
WaitForSingleObject( pi.hProcess, INFINITE );
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
return 0;
}