Delete protected task?

Smith, Gene gene.smith at siemens.com
Tue Jan 18 18:59:49 UTC 2005


Joel Sherrill <joel at OARcorp.com> wrote, On 1/18/2005 11:30 AM:

> 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.

Is this all done at the application level with no change to rtems?

> 
> You seem to be creeping in this direction one call at a time anyway.
> How many routines have you already worked through?
>

I have ported several low level vx...() such as  vxFirstBit().

Also, several semaphore related calls that are used such as
semTake and semGive.

Interrupt stuff like intDisable, intEnable, intConnect.

Have done
taskDelay, taskLock, taskUnlock,
taskSafe/taskUnsafe (dummy versions).

In the "task" category still need to do
taskPriorityGet
taskIdSelf
taskIsReady
taskDelete
taskResume
taskSpawn
taskSuspend
taskTcb
taskHookInit
taskSwitchHookAdd/Delete

-gene










More information about the users mailing list