Results 1 to 10 of 35

Thread: Some gravity particles

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #17
    Empty while loop is worse, for sure: use TThread.WaitFor. You probably want something like this in your TPhysicsMainThread:

    Code:
     
      threads: array [0..MAX_THREADS-1] of TPhysicsThread;
    
    ...
      
         stars_per_thread := count div MAX_THREADS;
            for i := low(threads) to high(threads) do
                threads[i] := TPhysicsThread.Create(FParent, i * stars_per_thread, (i + 1) * stars_per_thread - 1);
            for i := low(threads) to high(threads) do begin
                threads[i].WaitFor;
                threads[i].Free;
            end;
    Last edited by imcold; 14-06-2013 at 06:22 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •