You start your thread directly when create it: TMyThread.Create(false);
(the false is for the CreateSuspended parameter)
You need to set the priority before executing the thread. Also... the assignment of starts and stops could be too late as the thread might have already started with the execution. So you could need to override Create() with your parameters and set them in create() of create the thread with CreateSuspended = true. Like so:
T[0] := TMyThread.Create(true);
T[0].starts := 0;
T[0].stopts := 536870911;
T[0].FreeOnTerminate := true;
T[0].Priority := tpTimeCritical;
T[0].Resume;
O, and B.T.W. your program only runs for about 2 or 3 seconds for me. The loops are too short to really see the CPU go to 100%.
If you change it to "repeat until false;" then it will run forever (or until you kill the program).
4 thread got me to 60%
6 thread got me to 88%
On a machine with 4 cores and 8 threads according to
CPU-Z.
Edit: Woops... well. if you
really want the 100% you need to create 8 threads (as stated by cpu-z). It locked my system up completely (needed to do a hard reboot). Don't forget to make the loop longer but not indefinite because then you'll have to restart you machine too
What does having 4 cores and 8 threads?