Commit 2a94b5a5 authored by Your Name's avatar Your Name
Browse files

.

parent 1a60cf5e
No preview for this file type
......@@ -20,6 +20,9 @@ using namespace std;
using namespace lsl;
using namespace boost;
const int sched_policy = SCHED_FIFO;
const int sched_priority = 90;
static int verbose = 0;
stream_outlet *outlet;
string info_name, info_type, info_sourceid;
......@@ -92,19 +95,19 @@ int rtpriority(int n)
memset (&sched, 0, sizeof(sched)) ;
if (n > sched_get_priority_max (SCHED_FIFO))
sched.sched_priority = sched_get_priority_max (SCHED_FIFO) ;
if (n > sched_get_priority_max (sched_policy))
sched.sched_priority = sched_get_priority_max (sched_policy) ;
else
sched.sched_priority = n ;
return sched_setscheduler (0, SCHED_FIFO, &sched) ;
return sched_setscheduler (0, sched_policy, &sched) ;
}
int main (int argc, const char *argv[])
{
parse_options(argc, argv);
if (rtpriority(10) < 0) {
if (rtpriority(sched_priority) < 0) {
perror("rtpriority");
return 1;
}
......@@ -126,10 +129,10 @@ int main (int argc, const char *argv[])
// set priority
// GW: check threads with 'ps -mLca'
//void * c = (void *) context;
//zmq_ctx_set(c,ZMQ_THREAD_SCHED_POLICY,SCHED_FIFO);
//zmq_ctx_set(c,ZMQ_THREAD_PRIORITY,10);
//zmq_ctx_set(c,ZMQ_THREAD_SCHED_POLICY,sched_policy);
//zmq_ctx_set(c,ZMQ_THREAD_PRIORITY,sched_priority);
//if (rtpriority(10) < 0) {
//if (rtpriority(sched_priority) < 0) {
//perror("rtpriority");
//return 1;
//}
......
......@@ -22,6 +22,9 @@ using namespace std;
using namespace boost;
using namespace lsl;
const int sched_policy = SCHED_FIFO;
const int sched_priority = 90;
const int chan_left = 13; // PWM1 audio to jack
const int chan_right = 12; // PWM0 audio to jack
......@@ -198,19 +201,19 @@ int rtpriority(int n)
memset (&sched, 0, sizeof(sched)) ;
if (n > sched_get_priority_max (SCHED_FIFO))
sched.sched_priority = sched_get_priority_max (SCHED_FIFO) ;
if (n > sched_get_priority_max (sched_policy))
sched.sched_priority = sched_get_priority_max (sched_policy) ;
else
sched.sched_priority = n ;
return sched_setscheduler (0, SCHED_FIFO, &sched) ;
return sched_setscheduler (0, sched_policy, &sched) ;
}
int main(int argc, const char* argv[])
{
parse_options(argc, argv);
if (rtpriority(10) < 0) {
if (rtpriority(sched_priority) < 0) {
perror("rtpriority");
return 1;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment