Jan-Henrik Haukeland wrote:

> A thight loop (without sleep or yield), like the one above, will not
> let the gc thread in on the party. That's the case if you run on a
> preemptive JVM (i.e. with green threads) with real time slicing
> (native threads) it'll work.

The same thing happens with a Thread.yield();
(in pre1 and pre2)

I've tried moving the yield statement around to no avail...

import java.util.*;
public class SBTest {
   public SBTest() {
      int i = 0;
      while(true) {
         System.out.println(i + " ");
         i++;
         System.out.flush();
         System.gc();
         Thread.yield();
      }
   }

   public static void main(String args[]) {
      SBTest t = new SBTest();
   }
}

Crispin



----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to