Rainer Gerhards wrote:
> > I suppose it can be done, but pthread_setschedparam(pthread_self(),
> > SCHED_FIFO, ...) is portable, simpler and better for my purposes. Also
> > slightly dangerous, if one doesn't have enough processors for all RT
> > threads. :-)
> 
> 
> If that's all that is needed, I could very probably hack this together while
> I wait for a longer running test...

There are two parameters needed:
1. policy: probably a string that maps to SCHED_xxx, ie:
   fifo  => SCHED_FIFO
   rr    => SCHED_RR
   other => SCHED_OTHER

The code for those mappings should probably be in the appropriate
"#ifdef SCHED_xxx" guards. They should be defined if
pthread_setschedparam() is available, but you never know.

Ignore SCHED_SPORADIC for the time being.

2. priority (integer), goes into the third argument for
   pthread_setschedparam().

Without defaults for any of these parameters. If one of them is specified
in the config file and the other is not, report an error.

Add a configure check (it's possible you'd need -lrt or something similar),
and that's about that.

-- 
 .-.   .-.    Yes, I am an agent of Satan, but my duties are largely
(_  \ /  _)   ceremonial.
     |
     |        [email protected]
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

Reply via email to