[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r10217 - gnuradio/branches/developers/eb/gcell-wip/gce
From: |
eb |
Subject: |
[Commit-gnuradio] r10217 - gnuradio/branches/developers/eb/gcell-wip/gcell/lib/runtime |
Date: |
Tue, 13 Jan 2009 20:29:23 -0700 (MST) |
Author: eb
Date: 2009-01-13 20:29:22 -0700 (Tue, 13 Jan 2009)
New Revision: 10217
Modified:
gnuradio/branches/developers/eb/gcell-wip/gcell/lib/runtime/gc_job_manager_impl.cc
Log:
set polling thread priority low
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-14 02:43:33 UTC (rev 10216)
+++
gnuradio/branches/developers/eb/gcell-wip/gcell/lib/runtime/gc_job_manager_impl.cc
2009-01-14 03:29:22 UTC (rev 10217)
@@ -38,7 +38,16 @@
#include <fcntl.h>
#include <string.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")
+#define __cctph() __asm__ volatile ("or 3,3,3" : : : "memory")
+#define __db8cyc() __asm__ volatile ("or 28,28,28" : : : "memory")
+#define __db10cyc() __asm__ volatile ("or 29,29,29" : : : "memory")
+#define __db12cyc() __asm__ volatile ("or 30,30,30" : : : "memory")
+#define __db16cyc() __asm__ volatile ("or 31,31,31" : : : "memory")
+
static const size_t CACHE_LINE_SIZE = 128;
static const unsigned int DEFAULT_MAX_JOBS = 128;
@@ -1098,22 +1107,25 @@
void
gc_job_manager_impl::poll_for_job_completion()
{
- static const int niter = 1000;
- bool handled_something = false;
+ static const int niter = 10000;
+ __cctpl(); // change current (h/w) thread priority to low
+
for (int n = 0; n < niter; n++){
for (unsigned int spe_num = 0; spe_num < d_options.nspes; spe_num++){
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:
if (debug())
printf("jc: job_done (0x%08x) from spu[%d]\n", msg, spe_num);
+
+ __cctpm(); // change current thread priority to medium
notify_clients_jobs_are_done(spe_num, MBOX_MSG_ARG(msg));
+ __cctpl();
break;
default:
@@ -1122,11 +1134,8 @@
}
}
}
- if (handled_something)
- return;
-
- // FIXME stall our thread pipeline to keep from sucking up all cycles
}
+ __cctpm();
}
//
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r10217 - gnuradio/branches/developers/eb/gcell-wip/gcell/lib/runtime,
eb <=