commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10226 - gnuradio/branches/developers/eb/gcell-wip/gce


From: eb
Subject: [Commit-gnuradio] r10226 - gnuradio/branches/developers/eb/gcell-wip/gcell/lib/runtime
Date: Wed, 14 Jan 2009 21:50:35 -0700 (MST)

Author: eb
Date: 2009-01-14 21:50:34 -0700 (Wed, 14 Jan 2009)
New Revision: 10226

Modified:
   
gnuradio/branches/developers/eb/gcell-wip/gcell/lib/runtime/gc_job_manager_impl.cc
   
gnuradio/branches/developers/eb/gcell-wip/gcell/lib/runtime/gc_job_manager_impl.h
Log:
sched_yield

Modified: 
gnuradio/branches/developers/eb/gcell-wip/gcell/lib/runtime/gc_job_manager_impl.cc
===================================================================
--- 
gnuradio/branches/developers/eb/gcell-wip/gcell/lib/runtime/gc_job_manager_impl.cc
  2009-01-15 04:11:53 UTC (rev 10225)
+++ 
gnuradio/branches/developers/eb/gcell-wip/gcell/lib/runtime/gc_job_manager_impl.cc
  2009-01-15 04:50:34 UTC (rev 10226)
@@ -37,7 +37,9 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <string.h>
+#include <sched.h>
 
+
 #define __nop() __asm__ volatile ("ori 0,0,0" : : : "memory")
 #define __cctpl() __asm__ volatile ("or 1,1,1" : : : "memory")
 #define __cctpm() __asm__ volatile ("or 2,2,2" : : : "memory")
@@ -1143,10 +1145,11 @@
 
 ////////////////////////////////////////////////////////////////////////
 
-void
+bool
 gc_job_manager_impl::poll_for_job_completion()
 {
   static const int niter = 10000;
+  bool handled_something = false;
 
   CCTPL();             // change current (h/w) thread priority to low
 
@@ -1156,6 +1159,7 @@
       volatile spe_spu_control_area_t *spe_ctrl = d_worker[spe_num].spe_ctrl;
       int nentries = spe_ctrl->SPU_Mbox_Stat & 0xFF;
       while (nentries-- > 0){
+       handled_something = true;
        unsigned int msg = spe_ctrl->SPU_Out_Mbox;
        switch(MBOX_MSG_OP(msg)){
        case OP_JOBS_DONE:
@@ -1175,6 +1179,7 @@
     }
   }
   CCTPM();
+  return handled_something;
 }
 
 //
@@ -1197,7 +1202,8 @@
       }
     }
 
-    poll_for_job_completion();
+    if (poll_for_job_completion())
+      sched_yield();
   }
 }
 

Modified: 
gnuradio/branches/developers/eb/gcell-wip/gcell/lib/runtime/gc_job_manager_impl.h
===================================================================
--- 
gnuradio/branches/developers/eb/gcell-wip/gcell/lib/runtime/gc_job_manager_impl.h
   2009-01-15 04:11:53 UTC (rev 10225)
+++ 
gnuradio/branches/developers/eb/gcell-wip/gcell/lib/runtime/gc_job_manager_impl.h
   2009-01-15 04:50:34 UTC (rev 10226)
@@ -177,7 +177,7 @@
   bool incr_njobs_active();
   void decr_njobs_active(int n);
   void tell_spes_to_check_queue();
-  void poll_for_job_completion();
+  bool poll_for_job_completion();
 
   // bitvector ops
   void bv_zero(unsigned long *bv);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]