[LITMUS^RT] Function 'is_running' and 'is_current_running'

Björn Brandenburg bbb at mpi-sws.org
Thu Jul 28 11:47:53 CEST 2016


> On 28 Jul 2016, at 12:44, shijunjie92 <shijunjie92 at gmail.com> wrote:
> 
>  
> I have noticed that you have rewritten the function 'is_running(t)' as 'is_current_running()' in the latest version.

I changed that because it stopped working. With the new underlying Linux version, it is not safe to check the state of just any process (without acquiring runqueue locks). You can only access the state of the currently scheduled process without locks.

> But how can we get one specific task's condition without the input to the funtion? I am confiused about the meaning of 'current’.

‘current’ is a “magic" Linux macro that evaluates to a pointer to the currently scheduled process on the local core.

- Björn






More information about the litmus-dev mailing list