SCHED_RR in Classic API?
joel.sherrill at OARcorp.com
Fri May 30 13:10:16 UTC 2003
Kamen Penev wrote:
> Joel Sherrill wrote:
> > So you can call pthread_XXX on a task created using the Classic API.
> > This would be the easiest way to get this scheduling mode.
> After successfully creating a classic task with:
> status = rtems_task_create(Task_name[MON_TASKNUM],
> RTEMS_MINIMUM_STACK_SIZE *
> assert (RTEMS_SUCCESSFUL == status);
> The following fails:
> pstatus = pthread_setschedparam(Task_id[MON_TASKNUM],
> pstatus is ESRCH, which was the result of _Objects_Get searching for the
> classic Task_id in _POSIX_Threads_Information (via _POSIX_Threads_Get)..
> What am I missing?
Nothing. It looks to me that the Classic API got this right and there
is a minor bug in the POSIX API. The Classic API calls _Thread_Get()
to translate a task ID into a (Thread_Control *). The POSIX API
should NOT have a _POSIX_Threads_get(). It should be calling
And then it would work.
As a simple solution to verify the idea beind the fix, change the
body of _POSIX_Threads_Get to call _Thread_Get instead of _Objects_Get.
Joel Sherrill, Ph.D. Director of Research & Development
joel at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the users