diff options
author | Philip Balister <philip@opensdr.com> | 2010-05-20 15:05:04 +0000 |
---|---|---|
committer | Philip Balister <philip@opensdr.com> | 2010-05-20 15:05:04 +0000 |
commit | a9fefde874503c0c4e0c542846c1dd1c74156d07 (patch) | |
tree | 325a81f6b2824f1c15796cf0b45cd617ef1ed186 /host | |
parent | 3bb874f8061f203d8adf6f07e61fd50a154e9906 (diff) | |
download | uhd-a9fefde874503c0c4e0c542846c1dd1c74156d07.tar.gz uhd-a9fefde874503c0c4e0c542846c1dd1c74156d07.tar.bz2 uhd-a9fefde874503c0c4e0c542846c1dd1c74156d07.zip |
Enable realtime scheduling in loopback test to prevent overruns.
Diffstat (limited to 'host')
-rw-r--r-- | host/apps/omap_debug/usrp-e-rw.c | 5 |
1 files changed, 5 insertions, 0 deletions
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); |