ich würde einen Master-Thread erstellen, der die Worker-Threads koordiniert... hier etwas Pseudo-Code:
Master-Thread:
Code:
while (more records available) do begin
while not (less than 10 worker-threads running) do sleep;
(start worker-thread with next record)
end
Worker-Thread:
Code:
(inc worker-thread-count)
(do work)
(
dec worker-thread-count)
terminate