SF.net SVN: jikesrvm:[15773] rvmroot/trunk/rvm/src/org/jikesrvm/scheduler

View: New views
1 Messages — Rating Filter:   Alert me  

SF.net SVN: jikesrvm:[15773] rvmroot/trunk/rvm/src/org/jikesrvm/scheduler

by mikebond :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Revision: 15773
          http://jikesrvm.svn.sourceforge.net/jikesrvm/?rev=15773&view=rev
Author:   mikebond
Date:     2009-09-01 23:23:30 +0000 (Tue, 01 Sep 2009)

Log Message:
-----------
Fix for RVM-850.  Make TimerThread run even when the adaptive system isn't included, but in that case TimerThread doesn't trigger yieldpoints: it only handles debug requests.

Modified Paths:
--------------
    rvmroot/trunk/rvm/src/org/jikesrvm/scheduler/RVMThread.java
    rvmroot/trunk/rvm/src/org/jikesrvm/scheduler/TimerThread.java

Modified: rvmroot/trunk/rvm/src/org/jikesrvm/scheduler/RVMThread.java
===================================================================
--- rvmroot/trunk/rvm/src/org/jikesrvm/scheduler/RVMThread.java 2009-08-28 21:08:26 UTC (rev 15772)
+++ rvmroot/trunk/rvm/src/org/jikesrvm/scheduler/RVMThread.java 2009-09-01 23:23:30 UTC (rev 15773)
@@ -1288,10 +1288,13 @@
     bindIfRequested();
 
     threadingInitialized = true;
+
+    // Always run timer thread, so we can respond to debug requests
+    TimerThread tt = new TimerThread();
+    tt.makeDaemon(true);
+    tt.start();
+
     if (VM.BuildForAdaptiveSystem) {
-      TimerThread tt = new TimerThread();
-      tt.makeDaemon(true);
-      tt.start();
       ObjectHolder.boot();
     }
     CollectorThread.boot();

Modified: rvmroot/trunk/rvm/src/org/jikesrvm/scheduler/TimerThread.java
===================================================================
--- rvmroot/trunk/rvm/src/org/jikesrvm/scheduler/TimerThread.java 2009-08-28 21:08:26 UTC (rev 15772)
+++ rvmroot/trunk/rvm/src/org/jikesrvm/scheduler/TimerThread.java 2009-09-01 23:23:30 UTC (rev 15773)
@@ -48,18 +48,20 @@
       for (;;) {
         sysCall.sysNanoSleep(1000L*1000L*(long)VM.interruptQuantum);
 
-        // grab the lock to prevent threads from getting GC'd while we are
-        // iterating (since this thread doesn't stop for GC)
-        RVMThread.acctLock.lockNoHandshake();
-        RVMThread.timerTicks++;
-        for (int i=0;i<RVMThread.numThreads;++i) {
-          RVMThread candidate=RVMThread.threads[i];
-          if (candidate!=null && candidate.shouldBeSampled()) {
-            candidate.timeSliceExpired++;
-            candidate.takeYieldpoint=1;
+        if (VM.BuildForAdaptiveSystem) {
+          // grab the lock to prevent threads from getting GC'd while we are
+          // iterating (since this thread doesn't stop for GC)
+          RVMThread.acctLock.lockNoHandshake();
+          RVMThread.timerTicks++;
+          for (int i=0;i<RVMThread.numThreads;++i) {
+            RVMThread candidate=RVMThread.threads[i];
+            if (candidate!=null && candidate.shouldBeSampled()) {
+              candidate.timeSliceExpired++;
+              candidate.takeYieldpoint=1;
+            }
           }
+          RVMThread.acctLock.unlock();
         }
-        RVMThread.acctLock.unlock();
 
         RVMThread.checkDebugRequest();
       }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jikesrvm-commits mailing list
Jikesrvm-commits@...
https://lists.sourceforge.net/lists/listinfo/jikesrvm-commits