<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki-ext.aps.anl.gov/epics/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=TillStraumann</id>
	<title>EPICSWIKI - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki-ext.aps.anl.gov/epics/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=TillStraumann"/>
	<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=Special:Contributions/TillStraumann"/>
	<updated>2026-06-03T22:48:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=2939</id>
		<title>How To Use Posix Thread Priority Scheduling under Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=2939"/>
		<updated>2011-08-31T03:35:44Z</updated>

		<summary type="html">&lt;p&gt;TillStraumann: /* Work-around */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is this about? ==&lt;br /&gt;
&lt;br /&gt;
The linux scheduler supports the &lt;br /&gt;
SCHED_FIFO scheduling policy defined by POSIX.1-2001. Threads scheduled with this &amp;quot;real-time&amp;quot; policy can be assigned a priority (under linux) in the range 1..99 with 99 representing the highest priority. Since ordinary, &amp;quot;non-real time&amp;quot; processes execute at priority 0 (&amp;lt;tt&amp;gt;nice(1)&amp;lt;/tt&amp;gt; modifies a &amp;quot;dynamic priority&amp;quot; which only affects processes with real-time priority 0 and implements fair timesharing among such processes) SCHED_FIFO threads are always capable to preempt &amp;quot;ordinary processes&amp;quot; (these use the policy SCHED_OTHER).&lt;br /&gt;
&lt;br /&gt;
Note, however, that unless the linux kernel is built with the RT_PREEMPT patch&lt;br /&gt;
and measures are taken to lock the EPICS process in memory etc.,&lt;br /&gt;
no strictly deterministic latencies can be expected even under the&lt;br /&gt;
SCHED_FIFO policy which thus is to be considered ''soft-real time''.&lt;br /&gt;
&lt;br /&gt;
== How can I let epicsThreads use the SCHED_FIFO policy? ==&lt;br /&gt;
&lt;br /&gt;
In order to let EPICS use the SCHED_FIFO real-time policy you first need to check that the following option is set to &amp;quot;YES&amp;quot; in &amp;lt;tt&amp;gt;epics-base/configure/CONFIG_SITE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Use POSIX thread priority scheduling (YES or NO)&lt;br /&gt;
USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you find that the current setting is &amp;quot;NO&amp;quot; then you need to ''rebuild'' EPICS base (&amp;lt;tt&amp;gt;make clean uninstall; make&amp;lt;/tt&amp;gt;) after changing to 'YES'.&lt;br /&gt;
&lt;br /&gt;
Since engaging the SCHED_FIFO policy gives any thread created under that policy&lt;br /&gt;
a higher priority than any normal process'es using SCHED_FIFO requires special&lt;br /&gt;
''privileges''. Under a reasonably recent linux equipped with the&lt;br /&gt;
&amp;lt;tt&amp;gt;pam_security&amp;lt;/tt&amp;gt; module it is not necessary to execute EPICS as ''root''.&lt;br /&gt;
The system administrator can define the maximum priority that may be used&lt;br /&gt;
by specific users and/or groups in a file under &amp;lt;tt&amp;gt;/etc/security/limits.d/&amp;lt;/tt&amp;gt;, see the manpage for &amp;lt;tt&amp;gt;limits.conf(5)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
E.g., if a file &amp;lt;tt&amp;gt;/etc/security.limits.d/epics.conf&amp;lt;/tt&amp;gt; is created with &lt;br /&gt;
the following contents (it may be necessary for a user to log out&lt;br /&gt;
and log back on in order to obtain the new privileges):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
someuser hard rtprio 20&lt;br /&gt;
someuser soft rtprio  0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then processes created by 'someuser' still have priority 0 by default (this is&lt;br /&gt;
the 'soft' value) but 'someuser' may increase the resource limit up to 20 &lt;br /&gt;
either from a running program (using the system call &amp;lt;tt&amp;gt;setrlimit(2)&amp;lt;/tt&amp;gt;)&lt;br /&gt;
or within a shell e.g., with &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;'s &amp;lt;tt&amp;gt;ulimit -r&amp;lt;/tt&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
Note that a user process may set and/or lower its hard limit but ''never increase'' it. RTM.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
You need to do three things:&lt;br /&gt;
* Build EPICS base with &amp;lt;tt&amp;gt;USE_POSIX_THREAD_PRIORITY_SCHEDULING=YES&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Make sure your EPICS application process has sufficient privileges to use SCHED_FIFO and the desired priority range.&lt;br /&gt;
* Set the soft and hard RTPRIO limits for your EPICS application process to enable it to actually make use of the privilege. This step is required because it is usually a bad idea to run ''all'' processes created by a given user or group at real-time priorities.&lt;br /&gt;
&lt;br /&gt;
== End of the story? ==&lt;br /&gt;
Unfortunately, this is not the end of the story. Linux' &amp;lt;tt&amp;gt;sched_get_priority_max(2)&amp;lt;/tt&amp;gt; system call which is used&lt;br /&gt;
by EPICS to map EPICS priorities from/to linux/pthread priorities&lt;br /&gt;
always reports the maximal supported priority (99) without&lt;br /&gt;
considering any limits that the system enforces (as discussed above).&lt;br /&gt;
This has the consequence [https://bugs.launchpad.net/epics-base/+bug/835138 (see bug #835138)] that threads which are created with&lt;br /&gt;
a desired priority that is greater than the resource limit&lt;br /&gt;
eventually end up with the ''lowest'' priority 0.&lt;br /&gt;
&lt;br /&gt;
=== Work-around ===&lt;br /&gt;
* Either apply the [https://bugs.launchpad.net/epics-base/+bug/835138 bugfix] (AFAIK the problem is still present in 3.14.12.1, may be fixed thereafter)&lt;br /&gt;
* or make sure the RTPRIO limits are set to the maximally possible value (99)&lt;/div&gt;</summary>
		<author><name>TillStraumann</name></author>
	</entry>
	<entry>
		<id>https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1915</id>
		<title>How To Use Posix Thread Priority Scheduling under Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1915"/>
		<updated>2011-08-31T03:34:54Z</updated>

		<summary type="html">&lt;p&gt;TillStraumann: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is this about? ==&lt;br /&gt;
&lt;br /&gt;
The linux scheduler supports the &lt;br /&gt;
SCHED_FIFO scheduling policy defined by POSIX.1-2001. Threads scheduled with this &amp;quot;real-time&amp;quot; policy can be assigned a priority (under linux) in the range 1..99 with 99 representing the highest priority. Since ordinary, &amp;quot;non-real time&amp;quot; processes execute at priority 0 (&amp;lt;tt&amp;gt;nice(1)&amp;lt;/tt&amp;gt; modifies a &amp;quot;dynamic priority&amp;quot; which only affects processes with real-time priority 0 and implements fair timesharing among such processes) SCHED_FIFO threads are always capable to preempt &amp;quot;ordinary processes&amp;quot; (these use the policy SCHED_OTHER).&lt;br /&gt;
&lt;br /&gt;
Note, however, that unless the linux kernel is built with the RT_PREEMPT patch&lt;br /&gt;
and measures are taken to lock the EPICS process in memory etc.,&lt;br /&gt;
no strictly deterministic latencies can be expected even under the&lt;br /&gt;
SCHED_FIFO policy which thus is to be considered ''soft-real time''.&lt;br /&gt;
&lt;br /&gt;
== How can I let epicsThreads use the SCHED_FIFO policy? ==&lt;br /&gt;
&lt;br /&gt;
In order to let EPICS use the SCHED_FIFO real-time policy you first need to check that the following option is set to &amp;quot;YES&amp;quot; in &amp;lt;tt&amp;gt;epics-base/configure/CONFIG_SITE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Use POSIX thread priority scheduling (YES or NO)&lt;br /&gt;
USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you find that the current setting is &amp;quot;NO&amp;quot; then you need to ''rebuild'' EPICS base (&amp;lt;tt&amp;gt;make clean uninstall; make&amp;lt;/tt&amp;gt;) after changing to 'YES'.&lt;br /&gt;
&lt;br /&gt;
Since engaging the SCHED_FIFO policy gives any thread created under that policy&lt;br /&gt;
a higher priority than any normal process'es using SCHED_FIFO requires special&lt;br /&gt;
''privileges''. Under a reasonably recent linux equipped with the&lt;br /&gt;
&amp;lt;tt&amp;gt;pam_security&amp;lt;/tt&amp;gt; module it is not necessary to execute EPICS as ''root''.&lt;br /&gt;
The system administrator can define the maximum priority that may be used&lt;br /&gt;
by specific users and/or groups in a file under &amp;lt;tt&amp;gt;/etc/security/limits.d/&amp;lt;/tt&amp;gt;, see the manpage for &amp;lt;tt&amp;gt;limits.conf(5)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
E.g., if a file &amp;lt;tt&amp;gt;/etc/security.limits.d/epics.conf&amp;lt;/tt&amp;gt; is created with &lt;br /&gt;
the following contents (it may be necessary for a user to log out&lt;br /&gt;
and log back on in order to obtain the new privileges):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
someuser hard rtprio 20&lt;br /&gt;
someuser soft rtprio  0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then processes created by 'someuser' still have priority 0 by default (this is&lt;br /&gt;
the 'soft' value) but 'someuser' may increase the resource limit up to 20 &lt;br /&gt;
either from a running program (using the system call &amp;lt;tt&amp;gt;setrlimit(2)&amp;lt;/tt&amp;gt;)&lt;br /&gt;
or within a shell e.g., with &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;'s &amp;lt;tt&amp;gt;ulimit -r&amp;lt;/tt&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
Note that a user process may set and/or lower its hard limit but ''never increase'' it. RTM.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
You need to do three things:&lt;br /&gt;
* Build EPICS base with &amp;lt;tt&amp;gt;USE_POSIX_THREAD_PRIORITY_SCHEDULING=YES&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Make sure your EPICS application process has sufficient privileges to use SCHED_FIFO and the desired priority range.&lt;br /&gt;
* Set the soft and hard RTPRIO limits for your EPICS application process to enable it to actually make use of the privilege. This step is required because it is usually a bad idea to run ''all'' processes created by a given user or group at real-time priorities.&lt;br /&gt;
&lt;br /&gt;
== End of the story? ==&lt;br /&gt;
Unfortunately, this is not the end of the story. Linux' &amp;lt;tt&amp;gt;sched_get_priority_max(2)&amp;lt;/tt&amp;gt; system call which is used&lt;br /&gt;
by EPICS to map EPICS priorities from/to linux/pthread priorities&lt;br /&gt;
always reports the maximal supported priority (99) without&lt;br /&gt;
considering any limits that the system enforces (as discussed above).&lt;br /&gt;
This has the consequence [https://bugs.launchpad.net/epics-base/+bug/835138 (see bug #835138)] that threads which are created with&lt;br /&gt;
a desired priority that is greater than the resource limit&lt;br /&gt;
eventually end up with the ''lowest'' priority 0.&lt;br /&gt;
&lt;br /&gt;
=== Work-around ===&lt;br /&gt;
* Either apply the [https://bugs.launchpad.net/epics-base/+bug/835138 bugfix] (AFAIK the problem is still present in 3.14.12.1, may be fixed thereafter)&lt;br /&gt;
* or make sure the RTPRIO limit is set to the maximally possible value (99)&lt;/div&gt;</summary>
		<author><name>TillStraumann</name></author>
	</entry>
	<entry>
		<id>https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1914</id>
		<title>How To Use Posix Thread Priority Scheduling under Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1914"/>
		<updated>2011-08-31T03:28:44Z</updated>

		<summary type="html">&lt;p&gt;TillStraumann: /* How can I let epicsThreads use the SCHED_FIFO policy? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is this about? ==&lt;br /&gt;
&lt;br /&gt;
The linux scheduler supports the &lt;br /&gt;
SCHED_FIFO scheduling policy defined by POSIX.1-2001. Threads scheduled with this &amp;quot;real-time&amp;quot; policy can be assigned a priority (under linux) in the range 1..99 with 99 representing the highest priority. Since ordinary, &amp;quot;non-real time&amp;quot; processes execute at priority 0 (&amp;lt;tt&amp;gt;nice(1)&amp;lt;/tt&amp;gt; modifies a &amp;quot;dynamic priority&amp;quot; which only affects processes with real-time priority 0 and implements fair timesharing among such processes) SCHED_FIFO threads are always capable to preempt &amp;quot;ordinary processes&amp;quot; (these use the policy SCHED_OTHER).&lt;br /&gt;
&lt;br /&gt;
Note, however, that unless the linux kernel is built with the RT_PREEMPT patch&lt;br /&gt;
and measures are taken to lock the EPICS process in memory etc.,&lt;br /&gt;
no strictly deterministic latencies can be expected even under the&lt;br /&gt;
SCHED_FIFO policy which thus is to be considered ''soft-real time''.&lt;br /&gt;
&lt;br /&gt;
== How can I let epicsThreads use the SCHED_FIFO policy? ==&lt;br /&gt;
&lt;br /&gt;
In order to let EPICS use the SCHED_FIFO real-time policy you first need to check that the following option is set to &amp;quot;YES&amp;quot; in &amp;lt;tt&amp;gt;epics-base/configure/CONFIG_SITE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Use POSIX thread priority scheduling (YES or NO)&lt;br /&gt;
USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you find that the current setting is &amp;quot;NO&amp;quot; then you need to ''rebuild'' EPICS base (&amp;lt;tt&amp;gt;make clean uninstall; make&amp;lt;/tt&amp;gt;) after changing to 'YES'.&lt;br /&gt;
&lt;br /&gt;
Since engaging the SCHED_FIFO policy gives any thread created under that policy&lt;br /&gt;
a higher priority than any normal process'es using SCHED_FIFO requires special&lt;br /&gt;
''privileges''. Under a reasonably recent linux equipped with the&lt;br /&gt;
&amp;lt;tt&amp;gt;pam_security&amp;lt;/tt&amp;gt; module it is not necessary to execute EPICS as ''root''.&lt;br /&gt;
The system administrator can define the maximum priority that may be used&lt;br /&gt;
by specific users and/or groups in a file under &amp;lt;tt&amp;gt;/etc/security/limits.d/&amp;lt;/tt&amp;gt;, see the manpage for &amp;lt;tt&amp;gt;limits.conf(5)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
E.g., if a file &amp;lt;tt&amp;gt;/etc/security.limits.d/epics.conf&amp;lt;/tt&amp;gt; is created with &lt;br /&gt;
the following contents (it may be necessary for a user to log out&lt;br /&gt;
and log back on in order to obtain the new privileges):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
someuser hard rtprio 20&lt;br /&gt;
someuser soft rtprio  0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then processes created by 'someuser' still have priority 0 by default (this is&lt;br /&gt;
the 'soft' value) but 'someuser' may increase the resource limit up to 20 &lt;br /&gt;
either from a running program (using the system call &amp;lt;tt&amp;gt;setrlimit(2)&amp;lt;/tt&amp;gt;)&lt;br /&gt;
or within a shell e.g., with &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;'s &amp;lt;tt&amp;gt;ulimit -r&amp;lt;/tt&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
Note that a user process may set and/or lower its hard limit but ''never increase'' it. RTM.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
You need to do three things:&lt;br /&gt;
* Build EPICS base with &amp;lt;tt&amp;gt;USE_POSIX_THREAD_PRIORITY_SCHEDULING=YES&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Make sure your EPICS application process has sufficient privileges to use&lt;br /&gt;
  SCHED_FIFO and the desired priority range.&lt;br /&gt;
* Set the soft and hard RTPRIO limits for your EPICS application process&lt;br /&gt;
  to enable it to actually make use of the privilege. This step is required&lt;br /&gt;
  because it is usually a bad idea to run ''all'' processes created by a&lt;br /&gt;
  given user or group at real-time priorities.&lt;br /&gt;
&lt;br /&gt;
== End of the story? ==&lt;br /&gt;
Unfortunately, this is not the end of the story. Linux' &amp;lt;tt&amp;gt;sched_get_priority_max(2)&amp;lt;/tt&amp;gt; system call which is used&lt;br /&gt;
by EPICS to map EPICS priorities from/to linux/pthread priorities&lt;br /&gt;
always reports the maximal supported priority (99) without&lt;br /&gt;
considering any limits that the system enforces (as discussed above).&lt;br /&gt;
This has the consequence [https://bugs.launchpad.net/epics-base/+bug/835138 (see bug #835138)] that threads which are created with&lt;br /&gt;
a desired priority that is greater than the resource limit&lt;br /&gt;
eventually end up with the ''lowest'' priority 0.&lt;br /&gt;
&lt;br /&gt;
=== Work-around ===&lt;br /&gt;
* Either apply the [https://bugs.launchpad.net/epics-base/+bug/835138 bugfix] (AFAIK the problem is still present in 3.14.12.1, may be fixed thereafter)&lt;br /&gt;
* or make sure the RTPRIO limit is set to the maximally possible value (99)&lt;/div&gt;</summary>
		<author><name>TillStraumann</name></author>
	</entry>
	<entry>
		<id>https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1913</id>
		<title>How To Use Posix Thread Priority Scheduling under Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1913"/>
		<updated>2011-08-31T03:26:38Z</updated>

		<summary type="html">&lt;p&gt;TillStraumann: /* How can I let epicsThreads use the SCHED_FIFO policy? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is this about? ==&lt;br /&gt;
&lt;br /&gt;
The linux scheduler supports the &lt;br /&gt;
SCHED_FIFO scheduling policy defined by POSIX.1-2001. Threads scheduled with this &amp;quot;real-time&amp;quot; policy can be assigned a priority (under linux) in the range 1..99 with 99 representing the highest priority. Since ordinary, &amp;quot;non-real time&amp;quot; processes execute at priority 0 (&amp;lt;tt&amp;gt;nice(1)&amp;lt;/tt&amp;gt; modifies a &amp;quot;dynamic priority&amp;quot; which only affects processes with real-time priority 0 and implements fair timesharing among such processes) SCHED_FIFO threads are always capable to preempt &amp;quot;ordinary processes&amp;quot; (these use the policy SCHED_OTHER).&lt;br /&gt;
&lt;br /&gt;
Note, however, that unless the linux kernel is built with the RT_PREEMPT patch&lt;br /&gt;
and measures are taken to lock the EPICS process in memory etc.,&lt;br /&gt;
no strictly deterministic latencies can be expected even under the&lt;br /&gt;
SCHED_FIFO policy which thus is to be considered ''soft-real time''.&lt;br /&gt;
&lt;br /&gt;
== How can I let epicsThreads use the SCHED_FIFO policy? ==&lt;br /&gt;
&lt;br /&gt;
In order to let EPICS use the SCHED_FIFO real-time policy you first need to check that the following option is set to &amp;quot;YES&amp;quot; in &amp;lt;tt&amp;gt;epics-base/configure/CONFIG_SITE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Use POSIX thread priority scheduling (YES or NO)&lt;br /&gt;
USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you find that the current setting is &amp;quot;NO&amp;quot; then you need to ''rebuild'' EPICS base (&amp;lt;tt&amp;gt;make clean uninstall; make&amp;lt;/tt&amp;gt;) after changing to 'YES'.&lt;br /&gt;
&lt;br /&gt;
Since engaging the SCHED_FIFO policy gives any thread created under that policy&lt;br /&gt;
a higher priority than any normal process'es using SCHED_FIFO requires special&lt;br /&gt;
''privileges''. Under a reasonably recent linux equipped with the&lt;br /&gt;
&amp;lt;tt&amp;gt;pam_security&amp;lt;/tt&amp;gt; module it is not necessary to execute EPICS as ''root''.&lt;br /&gt;
The system administrator can define the maximum priority that may be used&lt;br /&gt;
by specific users and/or groups in a file under &amp;lt;tt&amp;gt;/etc/security/limits.d/&amp;lt;/tt&amp;gt;, see the manpage for &amp;lt;tt&amp;gt;limits.conf(5)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
E.g., if a file &amp;lt;tt&amp;gt;/etc/security.limits.d/epics.conf&amp;lt;/tt&amp;gt; is created with &lt;br /&gt;
the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
someuser hard rtprio 20&lt;br /&gt;
someuser soft rtprio  0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then processes created by 'someuser' still have priority 0 by default (this is&lt;br /&gt;
the 'soft' value) but 'someuser' may increase the resource limit up to 20 &lt;br /&gt;
either from a running program (using the system call &amp;lt;tt&amp;gt;setrlimit(2)&amp;lt;/tt&amp;gt;)&lt;br /&gt;
or within a shell e.g., with &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;'s &amp;lt;tt&amp;gt;ulimit -r&amp;lt;/tt&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
Note that a user process may set and/or lower its hard limit but ''never increase'' it. RTM.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
You need to do three things:&lt;br /&gt;
* Build EPICS base with &amp;lt;tt&amp;gt;USE_POSIX_THREAD_PRIORITY_SCHEDULING=YES&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Make sure your EPICS application process has sufficient privileges to use&lt;br /&gt;
  SCHED_FIFO and the desired priority range.&lt;br /&gt;
* Set the soft and hard RTPRIO limits for your EPICS application process&lt;br /&gt;
  to enable it to actually make use of the privilege. This step is required&lt;br /&gt;
  because it is usually a bad idea to run ''all'' processes created by a&lt;br /&gt;
  given user or group at real-time priorities.&lt;br /&gt;
&lt;br /&gt;
== End of the story? ==&lt;br /&gt;
Unfortunately, this is not the end of the story. Linux' &amp;lt;tt&amp;gt;sched_get_priority_max(2)&amp;lt;/tt&amp;gt; system call which is used&lt;br /&gt;
by EPICS to map EPICS priorities from/to linux/pthread priorities&lt;br /&gt;
always reports the maximal supported priority (99) without&lt;br /&gt;
considering any limits that the system enforces (as discussed above).&lt;br /&gt;
This has the consequence [https://bugs.launchpad.net/epics-base/+bug/835138 (see bug #835138)] that threads which are created with&lt;br /&gt;
a desired priority that is greater than the resource limit&lt;br /&gt;
eventually end up with the ''lowest'' priority 0.&lt;br /&gt;
&lt;br /&gt;
=== Work-around ===&lt;br /&gt;
* Either apply the [https://bugs.launchpad.net/epics-base/+bug/835138 bugfix] (AFAIK the problem is still present in 3.14.12.1, may be fixed thereafter)&lt;br /&gt;
* or make sure the RTPRIO limit is set to the maximally possible value (99)&lt;/div&gt;</summary>
		<author><name>TillStraumann</name></author>
	</entry>
	<entry>
		<id>https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1912</id>
		<title>How To Use Posix Thread Priority Scheduling under Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1912"/>
		<updated>2011-08-31T03:25:48Z</updated>

		<summary type="html">&lt;p&gt;TillStraumann: /* How can I let epicsThreads use the SCHED_FIFO policy? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is this about? ==&lt;br /&gt;
&lt;br /&gt;
The linux scheduler supports the &lt;br /&gt;
SCHED_FIFO scheduling policy defined by POSIX.1-2001. Threads scheduled with this &amp;quot;real-time&amp;quot; policy can be assigned a priority (under linux) in the range 1..99 with 99 representing the highest priority. Since ordinary, &amp;quot;non-real time&amp;quot; processes execute at priority 0 (&amp;lt;tt&amp;gt;nice(1)&amp;lt;/tt&amp;gt; modifies a &amp;quot;dynamic priority&amp;quot; which only affects processes with real-time priority 0 and implements fair timesharing among such processes) SCHED_FIFO threads are always capable to preempt &amp;quot;ordinary processes&amp;quot; (these use the policy SCHED_OTHER).&lt;br /&gt;
&lt;br /&gt;
Note, however, that unless the linux kernel is built with the RT_PREEMPT patch&lt;br /&gt;
and measures are taken to lock the EPICS process in memory etc.,&lt;br /&gt;
no strictly deterministic latencies can be expected even under the&lt;br /&gt;
SCHED_FIFO policy which thus is to be considered ''soft-real time''.&lt;br /&gt;
&lt;br /&gt;
== How can I let epicsThreads use the SCHED_FIFO policy? ==&lt;br /&gt;
&lt;br /&gt;
In order to let EPICS use the SCHED_FIFO real-time policy you first need to check that the following option is set to &amp;quot;YES&amp;quot; in &amp;lt;tt&amp;gt;epics-base/configure/CONFIG_SITE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Use POSIX thread priority scheduling (YES or NO)&lt;br /&gt;
USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you find that the current setting is &amp;quot;NO&amp;quot; then you need to ''rebuild'' EPICS base (&amp;lt;tt&amp;gt;make clean uninstall; make&amp;lt;/tt&amp;gt;) after changing to 'YES'.&lt;br /&gt;
&lt;br /&gt;
Since engaging the SCHED_FIFO policy gives any thread created under that policy&lt;br /&gt;
a higher priority than any normal process'es using SCHED_FIFO requires special&lt;br /&gt;
''privileges''. Under a reasonably recent linux equipped with the&lt;br /&gt;
&amp;lt;tt&amp;gt;pam_security&amp;lt;/tt&amp;gt; module it is not necessary to execute EPICS as ''root''.&lt;br /&gt;
The system administrator can define the maximum priority that may be used&lt;br /&gt;
by specific users and/or groups in a file under &amp;lt;tt&amp;gt;/etc/security/limits.d/&amp;lt;/tt&amp;gt;, see the manpage for &amp;lt;tt&amp;gt;limits.conf(5)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
E.g., if a file &amp;lt;tt&amp;gt;/etc/security.limits.d/epics.conf&amp;lt;/tt&amp;gt; is created with &lt;br /&gt;
the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
someuser hard rtprio 20&lt;br /&gt;
someuser soft rtprio  0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then processes created by 'someuser' still have priority 0 by default (this is&lt;br /&gt;
the 'soft' value) but 'someuser' may increase the resource limit up to 20 &lt;br /&gt;
either from a running program (using the system call &amp;lt;tt&amp;gt;setrlimit(2)&amp;lt;/tt&amp;gt;)&lt;br /&gt;
or within a shell e.g., with &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;'s &amp;lt;tt&amp;gt;ulimit -r&amp;lt;/tt&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
Note that a user process may set and/or lower its hard limit but ''never increase'' it. RTM.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
You need to do three things:&lt;br /&gt;
* Build EPICS base with &amp;lt;tt&amp;gt;USE_POSIX_THREAD_PRIORITY_SCHEDULING=YES&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Make sure your EPICS application process has sufficient privileges to use&lt;br /&gt;
  SCHED_FIFO and the desired priority range.&lt;br /&gt;
* Set the soft and hard RTPRIO limits for your EPICS application process&lt;br /&gt;
  to enable it to actually make use of the privilege. This step is required&lt;br /&gt;
  because it is usually a bad idea to run ''all'' processes created by a&lt;br /&gt;
  given user or group at real-time priorities.&lt;br /&gt;
&lt;br /&gt;
== End of the story? ==&lt;br /&gt;
Unfortunately, this is not the end of the story. Linux' &amp;lt;tt&amp;gt;sched_get_priority_max(2)&amp;lt;/tt&amp;gt; system call which is used&lt;br /&gt;
by EPICS to map EPICS priorities from/to linux/pthread priorities&lt;br /&gt;
always reports the maximal supported priority (99) without&lt;br /&gt;
considering any limits that the system enforces (as discussed above).&lt;br /&gt;
This has the consequence [https://bugs.launchpad.net/epics-base/+bug/835138 (see bug #835138)] that threads which are created with&lt;br /&gt;
a desired priority that is greater than the resource limit&lt;br /&gt;
eventually end up with the ''lowest'' priority 0.&lt;br /&gt;
&lt;br /&gt;
=== Work-around ===&lt;br /&gt;
* Either apply the [https://bugs.launchpad.net/epics-base/+bug/835138 bugfix] (AFAIK the problem is still present in 3.14.12.1, may be fixed thereafter)&lt;br /&gt;
* or make sure the RTPRIO limit is set to the maximally possible value (99)&lt;/div&gt;</summary>
		<author><name>TillStraumann</name></author>
	</entry>
	<entry>
		<id>https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1911</id>
		<title>How To Use Posix Thread Priority Scheduling under Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1911"/>
		<updated>2011-08-31T03:23:52Z</updated>

		<summary type="html">&lt;p&gt;TillStraumann: /* What is this about? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is this about? ==&lt;br /&gt;
&lt;br /&gt;
The linux scheduler supports the &lt;br /&gt;
SCHED_FIFO scheduling policy defined by POSIX.1-2001. Threads scheduled with this &amp;quot;real-time&amp;quot; policy can be assigned a priority (under linux) in the range 1..99 with 99 representing the highest priority. Since ordinary, &amp;quot;non-real time&amp;quot; processes execute at priority 0 (&amp;lt;tt&amp;gt;nice(1)&amp;lt;/tt&amp;gt; modifies a &amp;quot;dynamic priority&amp;quot; which only affects processes with real-time priority 0 and implements fair timesharing among such processes) SCHED_FIFO threads are always capable to preempt &amp;quot;ordinary processes&amp;quot; (these use the policy SCHED_OTHER).&lt;br /&gt;
&lt;br /&gt;
Note, however, that unless the linux kernel is built with the RT_PREEMPT patch&lt;br /&gt;
and measures are taken to lock the EPICS process in memory etc.,&lt;br /&gt;
no strictly deterministic latencies can be expected even under the&lt;br /&gt;
SCHED_FIFO policy which thus is to be considered ''soft-real time''.&lt;br /&gt;
&lt;br /&gt;
== How can I let epicsThreads use the SCHED_FIFO policy? ==&lt;br /&gt;
&lt;br /&gt;
In order to let EPICS use the SCHED_FIFO real-time policy you first need to check that the following option is set to &amp;quot;YES&amp;quot; in &amp;lt;tt&amp;gt;epics-base/configure/CONFIG_SITE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Use POSIX thread priority scheduling (YES or NO)&lt;br /&gt;
USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you find that the current setting is &amp;quot;NO&amp;quot; then you need to ''rebuild'' EPICS base (&amp;lt;tt&amp;gt;make clean uninstall; make&amp;lt;/tt&amp;gt;) after changing to 'YES'.&lt;br /&gt;
&lt;br /&gt;
Since engaging the SCHED_FIFO policy gives any thread created under that policy&lt;br /&gt;
a higher priority than any normal process'es using SCHED_FIFO requires special&lt;br /&gt;
''privileges''. Under a reasonably recent linux equipped with the&lt;br /&gt;
&amp;lt;tt&amp;gt;pam_security&amp;lt;/tt&amp;gt; module it is not necessary to execute EPICS as ''root''.&lt;br /&gt;
The system administrator can define the maximum priority that may be used&lt;br /&gt;
by specific users and/or groups in a file under &amp;lt;tt&amp;gt;/etc/security/limits.d/&amp;lt;/tt&amp;gt;, see man limits.conf(5).&lt;br /&gt;
&lt;br /&gt;
E.g., if a file &amp;lt;tt&amp;gt;/etc/security.limits.d/epics.conf&amp;lt;/tt&amp;gt; is created with &lt;br /&gt;
the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
someuser hard rtprio 20&lt;br /&gt;
someuser soft rtprio  0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then processes created by 'someuser' still have priority 0 by default (this is&lt;br /&gt;
the 'soft' value) but 'someuser' may increase the resource limit up to 20 &lt;br /&gt;
either from a running program (using the system call &amp;lt;tt&amp;gt;setrlimit(2)&amp;lt;/tt&amp;gt;)&lt;br /&gt;
or within a shell e.g., with &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;'s &amp;lt;tt&amp;gt;ulimit -r&amp;lt;/tt&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
Note that a user process may set and/or lower its hard limit but ''never increase'' it. RTM.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
You need to do three things:&lt;br /&gt;
* Build EPICS base with &amp;lt;tt&amp;gt;USE_POSIX_THREAD_PRIORITY_SCHEDULING=YES&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Make sure your EPICS application process has sufficient privileges to use&lt;br /&gt;
  SCHED_FIFO and the desired priority range.&lt;br /&gt;
* Set the soft and hard RTPRIO limits for your EPICS application process&lt;br /&gt;
  to enable it to actually make use of the privilege. This step is required&lt;br /&gt;
  because it is usually a bad idea to run ''all'' processes created by a&lt;br /&gt;
  given user or group at real-time priorities.&lt;br /&gt;
&lt;br /&gt;
== End of the story? ==&lt;br /&gt;
Unfortunately, this is not the end of the story. Linux' &amp;lt;tt&amp;gt;sched_get_priority_max(2)&amp;lt;/tt&amp;gt; system call which is used&lt;br /&gt;
by EPICS to map EPICS priorities from/to linux/pthread priorities&lt;br /&gt;
always reports the maximal supported priority (99) without&lt;br /&gt;
considering any limits that the system enforces (as discussed above).&lt;br /&gt;
This has the consequence [https://bugs.launchpad.net/epics-base/+bug/835138 (see bug #835138)] that threads which are created with&lt;br /&gt;
a desired priority that is greater than the resource limit&lt;br /&gt;
eventually end up with the ''lowest'' priority 0.&lt;br /&gt;
&lt;br /&gt;
=== Work-around ===&lt;br /&gt;
* Either apply the [https://bugs.launchpad.net/epics-base/+bug/835138 bugfix] (AFAIK the problem is still present in 3.14.12.1, may be fixed thereafter)&lt;br /&gt;
* or make sure the RTPRIO limit is set to the maximally possible value (99)&lt;/div&gt;</summary>
		<author><name>TillStraumann</name></author>
	</entry>
	<entry>
		<id>https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1910</id>
		<title>How To Use Posix Thread Priority Scheduling under Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1910"/>
		<updated>2011-08-31T03:22:40Z</updated>

		<summary type="html">&lt;p&gt;TillStraumann: /* What is this about? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is this about? ==&lt;br /&gt;
&lt;br /&gt;
The linux scheduler supports the &lt;br /&gt;
SCHED_FIFO scheduling policy defined by POSIX.1-2001. Threads scheduled with this &amp;quot;real-time&amp;quot; policy can be assigned a priority (under linux) in the range 1..99 with 99 representing the highest priority. Since ordinary, &amp;quot;non-real time&amp;quot; processes execute at priority 0 (&amp;quot;nice&amp;quot; modifies a &amp;quot;dynamic priority&amp;quot; which only affects processes with real-time priority 0 and implements fair timesharing among such processes) SCHED_FIFO threads are always capable to preempt &amp;quot;ordinary processes&amp;quot; (these use the policy SCHED_OTHER).&lt;br /&gt;
&lt;br /&gt;
Note, however, that unless the linux kernel is built with the RT_PREEMPT patch&lt;br /&gt;
and measures are taken to lock the EPICS process in memory etc.,&lt;br /&gt;
no strictly deterministic latencies can be expected even under the&lt;br /&gt;
SCHED_FIFO policy which thus is to be considered ''soft-real time''.&lt;br /&gt;
&lt;br /&gt;
== How can I let epicsThreads use the SCHED_FIFO policy? ==&lt;br /&gt;
&lt;br /&gt;
In order to let EPICS use the SCHED_FIFO real-time policy you first need to check that the following option is set to &amp;quot;YES&amp;quot; in &amp;lt;tt&amp;gt;epics-base/configure/CONFIG_SITE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Use POSIX thread priority scheduling (YES or NO)&lt;br /&gt;
USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you find that the current setting is &amp;quot;NO&amp;quot; then you need to ''rebuild'' EPICS base (&amp;lt;tt&amp;gt;make clean uninstall; make&amp;lt;/tt&amp;gt;) after changing to 'YES'.&lt;br /&gt;
&lt;br /&gt;
Since engaging the SCHED_FIFO policy gives any thread created under that policy&lt;br /&gt;
a higher priority than any normal process'es using SCHED_FIFO requires special&lt;br /&gt;
''privileges''. Under a reasonably recent linux equipped with the&lt;br /&gt;
&amp;lt;tt&amp;gt;pam_security&amp;lt;/tt&amp;gt; module it is not necessary to execute EPICS as ''root''.&lt;br /&gt;
The system administrator can define the maximum priority that may be used&lt;br /&gt;
by specific users and/or groups in a file under &amp;lt;tt&amp;gt;/etc/security/limits.d/&amp;lt;/tt&amp;gt;, see man limits.conf(5).&lt;br /&gt;
&lt;br /&gt;
E.g., if a file &amp;lt;tt&amp;gt;/etc/security.limits.d/epics.conf&amp;lt;/tt&amp;gt; is created with &lt;br /&gt;
the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
someuser hard rtprio 20&lt;br /&gt;
someuser soft rtprio  0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then processes created by 'someuser' still have priority 0 by default (this is&lt;br /&gt;
the 'soft' value) but 'someuser' may increase the resource limit up to 20 &lt;br /&gt;
either from a running program (using the system call &amp;lt;tt&amp;gt;setrlimit(2)&amp;lt;/tt&amp;gt;)&lt;br /&gt;
or within a shell e.g., with &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;'s &amp;lt;tt&amp;gt;ulimit -r&amp;lt;/tt&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
Note that a user process may set and/or lower its hard limit but ''never increase'' it. RTM.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
You need to do three things:&lt;br /&gt;
* Build EPICS base with &amp;lt;tt&amp;gt;USE_POSIX_THREAD_PRIORITY_SCHEDULING=YES&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Make sure your EPICS application process has sufficient privileges to use&lt;br /&gt;
  SCHED_FIFO and the desired priority range.&lt;br /&gt;
* Set the soft and hard RTPRIO limits for your EPICS application process&lt;br /&gt;
  to enable it to actually make use of the privilege. This step is required&lt;br /&gt;
  because it is usually a bad idea to run ''all'' processes created by a&lt;br /&gt;
  given user or group at real-time priorities.&lt;br /&gt;
&lt;br /&gt;
== End of the story? ==&lt;br /&gt;
Unfortunately, this is not the end of the story. Linux' &amp;lt;tt&amp;gt;sched_get_priority_max(2)&amp;lt;/tt&amp;gt; system call which is used&lt;br /&gt;
by EPICS to map EPICS priorities from/to linux/pthread priorities&lt;br /&gt;
always reports the maximal supported priority (99) without&lt;br /&gt;
considering any limits that the system enforces (as discussed above).&lt;br /&gt;
This has the consequence [https://bugs.launchpad.net/epics-base/+bug/835138 (see bug #835138)] that threads which are created with&lt;br /&gt;
a desired priority that is greater than the resource limit&lt;br /&gt;
eventually end up with the ''lowest'' priority 0.&lt;br /&gt;
&lt;br /&gt;
=== Work-around ===&lt;br /&gt;
* Either apply the [https://bugs.launchpad.net/epics-base/+bug/835138 bugfix] (AFAIK the problem is still present in 3.14.12.1, may be fixed thereafter)&lt;br /&gt;
* or make sure the RTPRIO limit is set to the maximally possible value (99)&lt;/div&gt;</summary>
		<author><name>TillStraumann</name></author>
	</entry>
	<entry>
		<id>https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1909</id>
		<title>How To Use Posix Thread Priority Scheduling under Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1909"/>
		<updated>2011-08-31T03:21:27Z</updated>

		<summary type="html">&lt;p&gt;TillStraumann: /* End of the story? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is this about? ==&lt;br /&gt;
&lt;br /&gt;
The linux scheduler supports the &lt;br /&gt;
SCHED_FIFO scheduling policy defined by POSIX.1-2001. Threads scheduled with this &amp;quot;real-time&amp;quot; policy can be assigned a priority (under linux) in the range 1..99 with 99 representing the highest priority. Since ordinary, &amp;quot;non-real time&amp;quot; processes execute at priority 0 (&amp;quot;nice&amp;quot; affects a &amp;quot;dynamic priority&amp;quot; which only affects processes with real-time priority 0 and implements fair timesharing among such processes) SCHED_FIFO threads are always capable to preempt &amp;quot;ordinary processes&amp;quot; (these use the policy SCHED_OTHER).&lt;br /&gt;
&lt;br /&gt;
Note, however, that unless the linux kernel is built with the RT_PREEMPT patch&lt;br /&gt;
and measures are taken to lock the EPICS process in memory etc.,&lt;br /&gt;
no strictly deterministic latencies can be expected even under the&lt;br /&gt;
SCHED_FIFO policy which thus is to be considered ''soft-real time''.&lt;br /&gt;
&lt;br /&gt;
== How can I let epicsThreads use the SCHED_FIFO policy? ==&lt;br /&gt;
&lt;br /&gt;
In order to let EPICS use the SCHED_FIFO real-time policy you first need to check that the following option is set to &amp;quot;YES&amp;quot; in &amp;lt;tt&amp;gt;epics-base/configure/CONFIG_SITE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Use POSIX thread priority scheduling (YES or NO)&lt;br /&gt;
USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you find that the current setting is &amp;quot;NO&amp;quot; then you need to ''rebuild'' EPICS base (&amp;lt;tt&amp;gt;make clean uninstall; make&amp;lt;/tt&amp;gt;) after changing to 'YES'.&lt;br /&gt;
&lt;br /&gt;
Since engaging the SCHED_FIFO policy gives any thread created under that policy&lt;br /&gt;
a higher priority than any normal process'es using SCHED_FIFO requires special&lt;br /&gt;
''privileges''. Under a reasonably recent linux equipped with the&lt;br /&gt;
&amp;lt;tt&amp;gt;pam_security&amp;lt;/tt&amp;gt; module it is not necessary to execute EPICS as ''root''.&lt;br /&gt;
The system administrator can define the maximum priority that may be used&lt;br /&gt;
by specific users and/or groups in a file under &amp;lt;tt&amp;gt;/etc/security/limits.d/&amp;lt;/tt&amp;gt;, see man limits.conf(5).&lt;br /&gt;
&lt;br /&gt;
E.g., if a file &amp;lt;tt&amp;gt;/etc/security.limits.d/epics.conf&amp;lt;/tt&amp;gt; is created with &lt;br /&gt;
the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
someuser hard rtprio 20&lt;br /&gt;
someuser soft rtprio  0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then processes created by 'someuser' still have priority 0 by default (this is&lt;br /&gt;
the 'soft' value) but 'someuser' may increase the resource limit up to 20 &lt;br /&gt;
either from a running program (using the system call &amp;lt;tt&amp;gt;setrlimit(2)&amp;lt;/tt&amp;gt;)&lt;br /&gt;
or within a shell e.g., with &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;'s &amp;lt;tt&amp;gt;ulimit -r&amp;lt;/tt&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
Note that a user process may set and/or lower its hard limit but ''never increase'' it. RTM.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
You need to do three things:&lt;br /&gt;
* Build EPICS base with &amp;lt;tt&amp;gt;USE_POSIX_THREAD_PRIORITY_SCHEDULING=YES&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Make sure your EPICS application process has sufficient privileges to use&lt;br /&gt;
  SCHED_FIFO and the desired priority range.&lt;br /&gt;
* Set the soft and hard RTPRIO limits for your EPICS application process&lt;br /&gt;
  to enable it to actually make use of the privilege. This step is required&lt;br /&gt;
  because it is usually a bad idea to run ''all'' processes created by a&lt;br /&gt;
  given user or group at real-time priorities.&lt;br /&gt;
&lt;br /&gt;
== End of the story? ==&lt;br /&gt;
Unfortunately, this is not the end of the story. Linux' &amp;lt;tt&amp;gt;sched_get_priority_max(2)&amp;lt;/tt&amp;gt; system call which is used&lt;br /&gt;
by EPICS to map EPICS priorities from/to linux/pthread priorities&lt;br /&gt;
always reports the maximal supported priority (99) without&lt;br /&gt;
considering any limits that the system enforces (as discussed above).&lt;br /&gt;
This has the consequence [https://bugs.launchpad.net/epics-base/+bug/835138 (see bug #835138)] that threads which are created with&lt;br /&gt;
a desired priority that is greater than the resource limit&lt;br /&gt;
eventually end up with the ''lowest'' priority 0.&lt;br /&gt;
&lt;br /&gt;
=== Work-around ===&lt;br /&gt;
* Either apply the [https://bugs.launchpad.net/epics-base/+bug/835138 bugfix] (AFAIK the problem is still present in 3.14.12.1, may be fixed thereafter)&lt;br /&gt;
* or make sure the RTPRIO limit is set to the maximally possible value (99)&lt;/div&gt;</summary>
		<author><name>TillStraumann</name></author>
	</entry>
	<entry>
		<id>https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1908</id>
		<title>How To Use Posix Thread Priority Scheduling under Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1908"/>
		<updated>2011-08-31T03:09:41Z</updated>

		<summary type="html">&lt;p&gt;TillStraumann: /* Work-around */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is this about? ==&lt;br /&gt;
&lt;br /&gt;
The linux scheduler supports the &lt;br /&gt;
SCHED_FIFO scheduling policy defined by POSIX.1-2001. Threads scheduled with this &amp;quot;real-time&amp;quot; policy can be assigned a priority (under linux) in the range 1..99 with 99 representing the highest priority. Since ordinary, &amp;quot;non-real time&amp;quot; processes execute at priority 0 (&amp;quot;nice&amp;quot; affects a &amp;quot;dynamic priority&amp;quot; which only affects processes with real-time priority 0 and implements fair timesharing among such processes) SCHED_FIFO threads are always capable to preempt &amp;quot;ordinary processes&amp;quot; (these use the policy SCHED_OTHER).&lt;br /&gt;
&lt;br /&gt;
Note, however, that unless the linux kernel is built with the RT_PREEMPT patch&lt;br /&gt;
and measures are taken to lock the EPICS process in memory etc.,&lt;br /&gt;
no strictly deterministic latencies can be expected even under the&lt;br /&gt;
SCHED_FIFO policy which thus is to be considered ''soft-real time''.&lt;br /&gt;
&lt;br /&gt;
== How can I let epicsThreads use the SCHED_FIFO policy? ==&lt;br /&gt;
&lt;br /&gt;
In order to let EPICS use the SCHED_FIFO real-time policy you first need to check that the following option is set to &amp;quot;YES&amp;quot; in &amp;lt;tt&amp;gt;epics-base/configure/CONFIG_SITE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Use POSIX thread priority scheduling (YES or NO)&lt;br /&gt;
USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you find that the current setting is &amp;quot;NO&amp;quot; then you need to ''rebuild'' EPICS base (&amp;lt;tt&amp;gt;make clean uninstall; make&amp;lt;/tt&amp;gt;) after changing to 'YES'.&lt;br /&gt;
&lt;br /&gt;
Since engaging the SCHED_FIFO policy gives any thread created under that policy&lt;br /&gt;
a higher priority than any normal process'es using SCHED_FIFO requires special&lt;br /&gt;
''privileges''. Under a reasonably recent linux equipped with the&lt;br /&gt;
&amp;lt;tt&amp;gt;pam_security&amp;lt;/tt&amp;gt; module it is not necessary to execute EPICS as ''root''.&lt;br /&gt;
The system administrator can define the maximum priority that may be used&lt;br /&gt;
by specific users and/or groups in a file under &amp;lt;tt&amp;gt;/etc/security/limits.d/&amp;lt;/tt&amp;gt;, see man limits.conf(5).&lt;br /&gt;
&lt;br /&gt;
E.g., if a file &amp;lt;tt&amp;gt;/etc/security.limits.d/epics.conf&amp;lt;/tt&amp;gt; is created with &lt;br /&gt;
the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
someuser hard rtprio 20&lt;br /&gt;
someuser soft rtprio  0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then processes created by 'someuser' still have priority 0 by default (this is&lt;br /&gt;
the 'soft' value) but 'someuser' may increase the resource limit up to 20 &lt;br /&gt;
either from a running program (using the system call &amp;lt;tt&amp;gt;setrlimit(2)&amp;lt;/tt&amp;gt;)&lt;br /&gt;
or within a shell e.g., with &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;'s &amp;lt;tt&amp;gt;ulimit -r&amp;lt;/tt&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
Note that a user process may set and/or lower its hard limit but ''never increase'' it. RTM.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
You need to do three things:&lt;br /&gt;
* Build EPICS base with &amp;lt;tt&amp;gt;USE_POSIX_THREAD_PRIORITY_SCHEDULING=YES&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Make sure your EPICS application process has sufficient privileges to use&lt;br /&gt;
  SCHED_FIFO and the desired priority range.&lt;br /&gt;
* Set the soft and hard RTPRIO limits for your EPICS application process&lt;br /&gt;
  to enable it to actually make use of the privilege. This step is required&lt;br /&gt;
  because it is usually a bad idea to run ''all'' processes created by a&lt;br /&gt;
  given user or group at real-time priorities.&lt;br /&gt;
&lt;br /&gt;
== End of the story? ==&lt;br /&gt;
Unfortunately, this is not the end of the story. Linux' &amp;lt;tt&amp;gt;sched_get_priority_max(2)&amp;lt;/tt&amp;gt; system call which is used&lt;br /&gt;
by EPICS to map EPICS priorities from/to linux/pthread priorities&lt;br /&gt;
always reports the maximal supported priority (99) without&lt;br /&gt;
considering any limits that the system enforces (as discussed above).&lt;br /&gt;
This has the consequence that threads which are created with&lt;br /&gt;
a desired priority that is greater than the resource limit&lt;br /&gt;
eventually end up with the ''lowest'' priority 0.&lt;br /&gt;
&lt;br /&gt;
=== Work-around ===&lt;br /&gt;
* Either apply the bugfix&lt;br /&gt;
* or make sure the RTPRIO limit is set to the maximally possible value (99)&lt;/div&gt;</summary>
		<author><name>TillStraumann</name></author>
	</entry>
	<entry>
		<id>https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1907</id>
		<title>How To Use Posix Thread Priority Scheduling under Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1907"/>
		<updated>2011-08-31T03:08:47Z</updated>

		<summary type="html">&lt;p&gt;TillStraumann: /* How can I let epicsThreads use the SCHED_FIFO policy? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is this about? ==&lt;br /&gt;
&lt;br /&gt;
The linux scheduler supports the &lt;br /&gt;
SCHED_FIFO scheduling policy defined by POSIX.1-2001. Threads scheduled with this &amp;quot;real-time&amp;quot; policy can be assigned a priority (under linux) in the range 1..99 with 99 representing the highest priority. Since ordinary, &amp;quot;non-real time&amp;quot; processes execute at priority 0 (&amp;quot;nice&amp;quot; affects a &amp;quot;dynamic priority&amp;quot; which only affects processes with real-time priority 0 and implements fair timesharing among such processes) SCHED_FIFO threads are always capable to preempt &amp;quot;ordinary processes&amp;quot; (these use the policy SCHED_OTHER).&lt;br /&gt;
&lt;br /&gt;
Note, however, that unless the linux kernel is built with the RT_PREEMPT patch&lt;br /&gt;
and measures are taken to lock the EPICS process in memory etc.,&lt;br /&gt;
no strictly deterministic latencies can be expected even under the&lt;br /&gt;
SCHED_FIFO policy which thus is to be considered ''soft-real time''.&lt;br /&gt;
&lt;br /&gt;
== How can I let epicsThreads use the SCHED_FIFO policy? ==&lt;br /&gt;
&lt;br /&gt;
In order to let EPICS use the SCHED_FIFO real-time policy you first need to check that the following option is set to &amp;quot;YES&amp;quot; in &amp;lt;tt&amp;gt;epics-base/configure/CONFIG_SITE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Use POSIX thread priority scheduling (YES or NO)&lt;br /&gt;
USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you find that the current setting is &amp;quot;NO&amp;quot; then you need to ''rebuild'' EPICS base (&amp;lt;tt&amp;gt;make clean uninstall; make&amp;lt;/tt&amp;gt;) after changing to 'YES'.&lt;br /&gt;
&lt;br /&gt;
Since engaging the SCHED_FIFO policy gives any thread created under that policy&lt;br /&gt;
a higher priority than any normal process'es using SCHED_FIFO requires special&lt;br /&gt;
''privileges''. Under a reasonably recent linux equipped with the&lt;br /&gt;
&amp;lt;tt&amp;gt;pam_security&amp;lt;/tt&amp;gt; module it is not necessary to execute EPICS as ''root''.&lt;br /&gt;
The system administrator can define the maximum priority that may be used&lt;br /&gt;
by specific users and/or groups in a file under &amp;lt;tt&amp;gt;/etc/security/limits.d/&amp;lt;/tt&amp;gt;, see man limits.conf(5).&lt;br /&gt;
&lt;br /&gt;
E.g., if a file &amp;lt;tt&amp;gt;/etc/security.limits.d/epics.conf&amp;lt;/tt&amp;gt; is created with &lt;br /&gt;
the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
someuser hard rtprio 20&lt;br /&gt;
someuser soft rtprio  0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then processes created by 'someuser' still have priority 0 by default (this is&lt;br /&gt;
the 'soft' value) but 'someuser' may increase the resource limit up to 20 &lt;br /&gt;
either from a running program (using the system call &amp;lt;tt&amp;gt;setrlimit(2)&amp;lt;/tt&amp;gt;)&lt;br /&gt;
or within a shell e.g., with &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt;'s &amp;lt;tt&amp;gt;ulimit -r&amp;lt;/tt&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
Note that a user process may set and/or lower its hard limit but ''never increase'' it. RTM.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
You need to do three things:&lt;br /&gt;
* Build EPICS base with &amp;lt;tt&amp;gt;USE_POSIX_THREAD_PRIORITY_SCHEDULING=YES&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Make sure your EPICS application process has sufficient privileges to use&lt;br /&gt;
  SCHED_FIFO and the desired priority range.&lt;br /&gt;
* Set the soft and hard RTPRIO limits for your EPICS application process&lt;br /&gt;
  to enable it to actually make use of the privilege. This step is required&lt;br /&gt;
  because it is usually a bad idea to run ''all'' processes created by a&lt;br /&gt;
  given user or group at real-time priorities.&lt;br /&gt;
&lt;br /&gt;
== End of the story? ==&lt;br /&gt;
Unfortunately, this is not the end of the story. Linux' &amp;lt;tt&amp;gt;sched_get_priority_max(2)&amp;lt;/tt&amp;gt; system call which is used&lt;br /&gt;
by EPICS to map EPICS priorities from/to linux/pthread priorities&lt;br /&gt;
always reports the maximal supported priority (99) without&lt;br /&gt;
considering any limits that the system enforces (as discussed above).&lt;br /&gt;
This has the consequence that threads which are created with&lt;br /&gt;
a desired priority that is greater than the resource limit&lt;br /&gt;
eventually end up with the ''lowest'' priority 0.&lt;br /&gt;
&lt;br /&gt;
=== Work-around ===&lt;br /&gt;
* Either apply the bugfix&lt;br /&gt;
* or make sure the RTPRIO limit is set to the maximally possible value&lt;/div&gt;</summary>
		<author><name>TillStraumann</name></author>
	</entry>
	<entry>
		<id>https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1906</id>
		<title>How To Use Posix Thread Priority Scheduling under Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux&amp;diff=1906"/>
		<updated>2011-08-30T20:44:56Z</updated>

		<summary type="html">&lt;p&gt;TillStraumann: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is this about? ==&lt;br /&gt;
&lt;br /&gt;
The linux scheduler supports the &lt;br /&gt;
SCHED_FIFO scheduling policy defined by POSIX.1-2001. Threads scheduled with this &amp;quot;real-time&amp;quot; policy can be assigned a priority (under linux) in the range 1..99 with 99 representing the highest priority. Since ordinary, &amp;quot;non-real time&amp;quot; processes execute at priority 0 (&amp;quot;nice&amp;quot; affects a &amp;quot;dynamic priority&amp;quot; which only affects processes with real-time priority 0 and implements fair timesharing among such processes) SCHED_FIFO threads are always capable to preempt &amp;quot;ordinary processes&amp;quot; (these use the policy SCHED_OTHER).&lt;br /&gt;
&lt;br /&gt;
Note, however, that unless the linux kernel is built with the RT_PREEMPT patch&lt;br /&gt;
and measures are taken to lock the EPICS process in memory etc.,&lt;br /&gt;
no strictly deterministic latencies can be expected even under the&lt;br /&gt;
SCHED_FIFO policy which thus is to be considered ''soft-real time''.&lt;br /&gt;
&lt;br /&gt;
== How can I let epicsThreads use the SCHED_FIFO policy? ==&lt;br /&gt;
&lt;br /&gt;
In order to let EPICS use the SCHED_FIFO real-time policy you first need to check that the following option is set to &amp;quot;YES&amp;quot; in &amp;lt;tt&amp;gt;epics-base/configure/CONFIG_SITE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Use POSIX thread priority scheduling (YES or NO)&lt;br /&gt;
USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you find that the current setting is &amp;quot;NO&amp;quot; then you need to ''rebuild'' EPICS base (&amp;lt;tt&amp;gt;make clean uninstall; make&amp;lt;/tt&amp;gt;) after changing to 'YES'.&lt;br /&gt;
&lt;br /&gt;
Since engaging the SCHED_FIFO policy gives any thread created under that policy&lt;br /&gt;
a higher priority than any normal process'es using SCHED_FIFO requires special&lt;br /&gt;
''privileges''. Under a reasonably recent linux equipped with the&lt;br /&gt;
&amp;lt;tt&amp;gt;pam_security&amp;lt;/tt&amp;gt; module it is not necessary to execute EPICS as ''root''.&lt;br /&gt;
The system administrator can define the maximum priority that may be used&lt;br /&gt;
by specific users and/or groups in a file under &amp;lt;tt&amp;gt;/etc/security/limits.d/&amp;lt;/tt&amp;gt;, see man limits.conf(5).&lt;br /&gt;
&lt;br /&gt;
E.g., if a file &amp;lt;tt&amp;gt;/etc/security.limits.d/epics.conf&amp;lt;/tt&amp;gt; is created with &lt;br /&gt;
the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
someuser hard rtprio 20&lt;br /&gt;
someuser soft rtprio  0&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then processes created by 'someuser' still have priority 0 by default (this is&lt;br /&gt;
the 'soft' value) but 'someuser' may increase the resource limit up to 20 &lt;br /&gt;
either from a running program (using the system call &amp;lt;tt&amp;gt;setrlimit(2)&amp;lt;/tt&amp;gt;)&lt;br /&gt;
or from a shell with the &amp;lt;tt&amp;gt;ulimit -r&amp;lt;/tt&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
Note that&lt;/div&gt;</summary>
		<author><name>TillStraumann</name></author>
	</entry>
	<entry>
		<id>https://wiki-ext.aps.anl.gov/epics/index.php?title=HowTo_Documents&amp;diff=1919</id>
		<title>HowTo Documents</title>
		<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=HowTo_Documents&amp;diff=1919"/>
		<updated>2011-08-30T17:12:00Z</updated>

		<summary type="html">&lt;p&gt;TillStraumann: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a directory of various How-To documents written by members of the EPICS collaboration.  Contributions to this page are most welcome!&lt;br /&gt;
&lt;br /&gt;
=== EPICS Base on Different Architectures and Operating Systems ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.aps.anl.gov/epics/base/RTEMS/tutorial/ Getting Started with EPICS on RTEMS]&lt;br /&gt;
* [[HowToPC104|Getting Started with R3.14.7 on a PC104 running Linux]]&lt;br /&gt;
* [[How To Port EPICS to a new OS/Architecture]]&lt;br /&gt;
* [[How To Use Posix Thread Priority Scheduling under Linux]]&lt;br /&gt;
&lt;br /&gt;
=== Drivers and Device Support ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.aps.anl.gov/epics/modules/soft/asyn/HowToDoSerial_StreamDevice.html How To Do Serial (using Asyn Driver and StreamDevice)]&lt;br /&gt;
* [http://www.aps.anl.gov/epics/modules/soft/asyn/R4-15/HowToDoSerial/tutorial.pdf How To Do Serial (using Asyn Driver and devGPIB)]&lt;br /&gt;
* [http://www.aps.anl.gov/epics/modules/soft/asyn/BeginnerGuideToASYN-VXI11.pdf Beginners Guide to using VXI-11 (with Asyn Driver)]&lt;br /&gt;
* [[How to make your EPICS driver operating system independent]]&lt;br /&gt;
* [[How To Write Device Support that uses Asyn Driver]] ''(Incomplete!)''&lt;br /&gt;
* [[How to use GPIB ports with linux-gpib and StreamDevice]]&lt;br /&gt;
&lt;br /&gt;
=== Applications ===&lt;br /&gt;
&lt;br /&gt;
* [[Common Database patterns]]&lt;br /&gt;
* [[How To Install Channel Archiver On Scientific Linux]]&lt;br /&gt;
* [[What PV Save and Restore Tools are available]]&lt;br /&gt;
* [[How to Add a New Breakpoint Table]]&lt;br /&gt;
* [[&amp;quot;Best Practice&amp;quot; Guidelines]]&lt;br /&gt;
&lt;br /&gt;
=== Infrastructure and Other Stuff ===&lt;br /&gt;
&lt;br /&gt;
* [[How To Set Up a Linux Box as an IOC Boot Server]]&lt;br /&gt;
* [[How To Set Up a Mirror of the EPICS Web Site]]&lt;br /&gt;
* [[How to Set Up a Soft IOC Framework on Linux]]&lt;br /&gt;
* [[How to Set Up Console Access and Logging for VME and Soft IOCs]]&lt;br /&gt;
* [[How to Set Up NAL (Nagios Alarm Handler) to monitor an EPICS network]]&lt;br /&gt;
&lt;br /&gt;
=== Collaboration Stuff ===&lt;br /&gt;
&lt;br /&gt;
* [[How to run an EPICS Collaboration Meeting]]&lt;/div&gt;</summary>
		<author><name>TillStraumann</name></author>
	</entry>
</feed>