From Curtis Rubel, "I would like to submit the attached file for inclusion in future releases of
OpenSceneGraph and the OpenThreads library. The changes in the file simply remove a few ifndef's that currently do not allow Linux systems to fully utilize the PThread real-time scheduling API. Since Linux now fully supports the PThread scheduling API it would be beneficial to have it available to use as necessary. I have been testing this change since OSG release 3.3.7 and have not seen any ill affects. The Priority scheduling api is further protected by another ifdef: #ifdef ALLOW_PRIORITY_SCHEDULING that only appears to be defined in the pthreads implementation as well. This would make it unlikely that anyone would be affected by this unless they are intentionally wanting to run with priority scheduling. In which case on Linux they would need to make these same modifications themselves to utilize it to its full extent. Attached file is for the current trunk as of this date. " git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15140 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
parent
7aae720636
commit
e878e53cab
@ -286,8 +286,6 @@ private:
|
||||
pthread_getschedparam(thread->getProcessId(),
|
||||
&th_policy, &th_param);
|
||||
|
||||
#ifndef __linux__
|
||||
|
||||
switch(thread->getSchedulePolicy())
|
||||
{
|
||||
|
||||
@ -312,24 +310,10 @@ private:
|
||||
break;
|
||||
};
|
||||
|
||||
#else
|
||||
th_policy = SCHED_OTHER; // Must protect linux from realtime.
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
max_priority = 0;
|
||||
min_priority = 20;
|
||||
nominal_priority = (max_priority + min_priority)/2;
|
||||
|
||||
#else
|
||||
|
||||
max_priority = sched_get_priority_max(th_policy);
|
||||
min_priority = sched_get_priority_min(th_policy);
|
||||
nominal_priority = (max_priority + min_priority)/2;
|
||||
|
||||
#endif
|
||||
|
||||
switch(thread->getSchedulePriority())
|
||||
{
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user