[LITMUS^RT] Task Activation

Björn Brandenburg bbb at mpi-sws.org
Fri Aug 31 15:02:00 CEST 2018


Dear Jorge,

> On 31. Aug 2018, at 13:07, Martinez Garcia Jorge Luis (PS-EC/ESB2) <JorgeLuis.MartinezGarcia at de.bosch.com> wrote:
> 
> I need implement the following scenario in LITMUS^RT: A background task should be released upon completion of one particular real-time task.

do you mean completion of a task or completion of a job? If you want to trigger some background activity after each job, you are probably better off pre-spawning a background process and communicating with it via a pipe or a counting semaphore. 

Anyway, to answer your question. What to do depends on which scheduler plugin you are using. If you are using a “classic” process-based plugin, then you just have to fork&exec the new process, because any forked processes are automatically “demoted” to background status. 

If you are using a modern reservation-based plugin (which I think you do), then follow the following steps:

1) fork()&exec() a child process

2) in the parent, call sched_setscheduler() on the child to set its scheduling class to SCHED_OTHER.

Alternatively, you can also make the child call sched_setscheduler() on itself after the fork and before exec()’ing the new process. 

> Do you have some examples on how to do this apart from what is found in https://www.litmus-rt.org/tutorial/tutorial-slides.pdf?

No, unfortunately not. Once you figure this out, please feel free to submit a pull request for a liblitmus documentation update. :-)

> By the way, where can I get the folder /opt/tutorial/ from (I am not using the LITMUS^RT Image suggested in the tutorial)?

I don’t think we currently have a separate download anywhere. 

@Manohar, can you dig this up somewhere? 

Thanks,
Björn





More information about the litmus-dev mailing list