Getting the execution state of a task

Mohammed Khoory mkhoory at eiast.ae
Fri Jul 5 01:44:14 UTC 2013


I actually found another method to doing this, although it's somewhat
awkward and ugly, and I haven't tested if it actually works yet. 

It involves the use of rtems_iterate_over_all_threads to run a function that
simply copies the needed data to a static variable, which other functions in
the application code can then read from. 

The manual says that rtems_iterate_over_all_threads shouldn't be used in
production code and is only meant for diagnostics.. but that's actually what
I need it for anyway, so I think it's ok, right?

I might end up writing a patch later if I decided that I really needed the
API call though.

Thanks,
Mohammed Khoory

>-----Original Message-----
>From: gedare at gwmail.gwu.edu [mailto:gedare at gwmail.gwu.edu] On Behalf
>Of Gedare Bloom
>Sent: Tuesday, July 02, 2013 10:21 PM
>To: Mohammed Khoory
>Cc: RTEMS
>Subject: Re: Getting the execution state of a task
>
>On Tue, Jul 2, 2013 at 5:11 AM, Mohammed Khoory <mkhoory at eiast.ae>
>wrote:
>> Hi,
>>
>> Is there any possible way to obtain the state of a task ID? i.e.
>> whether it's dormant, ready, executing, blocked, suspended, or deleted?
>>
>With a debugger yes.
>
>> I do know there is a way to determine whether a task is suspended, and
>> that is by using rtems_task_is_suspended, but does that also include
>> tasks that are blocked?
>>
>No, blocked is different from suspended. From inside RTEMS there is
>_States_Is_blocked, but this is not available from the application layer.
You
>may propose to add an rtems_task_is_blocked(), patches welcomed at rtems-
>devel mailing list.
>
>> Regards,
>> Mohammed Khoory
>>
>> _______________________________________________
>> rtems-users mailing list
>> rtems-users at rtems.org
>> http://www.rtems.org/mailman/listinfo/rtems-users




More information about the users mailing list