Delete protected task?
Joel Sherrill <joel@OARcorp.com>
joel.sherrill at OARcorp.com
Tue Jan 18 16:30:28 UTC 2005
Smith, Gene wrote:
>
> Joel Sherrill <joel at OARcorp.com> wrote, On 1/18/2005 10:06 AM:
>
>> Smith, Gene wrote:
>>
>>> Does rtems have the ability to set a task as delete protected? I
>>> can't find this in manual. Specifically, looking for something
>>> analogous to this:
>>>
>>> http://www.roe.ac.uk/atc/projects/vista/software/VxWorks/docs/vxworks/ref/taskLib.html#taskSafe
>>
>>
>>
>>
>> No. It doesn't.
>>
>> Off the top of my head, I don't see how to implement it without
>> changes to at least an API but a better solution would be in the
>> score.
>>
>
> I am not an expert on rtems internals but it seem like to me one way for
> a task to set itself delete protected would be using rtems_task_mode()
> and define a new mode RTEMS_NO_DELETE. This could be used internally in
> rtems to fail any call to rtems_task_delete() if set. However, the thing
> about the deleting task blocking on rtems_task_delete() sound a lot more
> complex.
>
> I looked in the cpukit/score/src area and see lots of thread*.c files.
> Is this approximately where you think this feature could be added?
Yes on first glance.
Another slightly different approach would be to start a library of these
calls. Then you could have a VxWorks per thread context associated
with each thread. Have a "nestable delete mutex" with each thread and
lock that when a task is "safe from delete."
The trick to the above would be to implicitly create a VxWorks context
the first time a thread calls a VxWorks routine requiring one.
You seem to be creeping in this direction one call at a time anyway.
How many routines have you already worked through?
> -gene
>
>
>
--
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
mailing list