From a9fefde874503c0c4e0c542846c1dd1c74156d07 Mon Sep 17 00:00:00 2001 From: Philip Balister Date: Thu, 20 May 2010 15:05:04 +0000 Subject: Enable realtime scheduling in loopback test to prevent overruns. --- host/apps/omap_debug/usrp-e-rw.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'host/apps/omap_debug/usrp-e-rw.c') diff --git a/host/apps/omap_debug/usrp-e-rw.c b/host/apps/omap_debug/usrp-e-rw.c index f96e4e25b..798bc4b45 100644 --- a/host/apps/omap_debug/usrp-e-rw.c +++ b/host/apps/omap_debug/usrp-e-rw.c @@ -142,6 +142,9 @@ int main(int argc, char *argv[]) { pthread_t tx, rx; long int t; + struct sched_param s = { + .sched_priority = 1 + }; if (argc < 2) { printf("%s data_size\n", argv[0]); @@ -153,6 +156,8 @@ int main(int argc, char *argv[]) fp = open("/dev/usrp_e0", O_RDWR); printf("fp = %d\n", fp); + sched_setscheduler(0, SCHED_RR, &s); + if (pthread_create(&rx, NULL, read_thread, (void *) t)) { printf("Failed to create rx thread\n"); exit(-1); -- cgit v1.2.3