Re: Suspending and Resuming a hard real time task

Jonas Schulze <[email protected]>
Newsgroups gmane.linux.real-time.rtai
Message-ID <9342DC0D76E23A4EA3F8BB9084C1AF571D7E61A1@BREMEN.FSRNET.INTRANET.LOCAL>
I know that what I am doing here is contradicting to the concept of hard real time. When setting up the system it wasn't expected that there would be problems with this network API. However, the system may be used in another context without this API, where the meaning of hard real time would be restored.

Like always, thanks for your input!

Best Regards
Jonas

---------------------------
Jonas Schulze, M. Sc.
Technische Universität Darmstadt
Flugsysteme und Regelungstechnik
Otto-Berndt Straße 2
64287 Darmstadt, Germany

Tel.:      +49(0)6151/16-21077
Fax:      +49(0)6151/16-21050
E-Mail: [email protected]<mailto:[email protected]>
URL:     www.fsr.tu-darmstadt.de<http://www.fsr.tu-darmstadt.de/>



Von: Paolo Mantegazza [mailto:[email protected]]
Gesendet: 17 December 2015 09:07
An: Jonas Schulze; [email protected]
Betreff: Re: [Rtai] Suspending and Resuming a hard real time task

On 12/16/2015 03:35 PM, Jonas Schulze wrote:
Hi,

in my project I am using a soft real time task to perform some computations and network communications, and a periodic hard real time task in a different thread to perform other computations.

For the network communications in soft real time I need to use an third party API. Now the program crashed at random places with "malloc() corruption (fast)" error. Our conclusion was that the program crashes if the soft real time task is paused due to the activation of the hard real time task, while it is carring out the "read" or "write" network functions. So what we did is

.
.
.
Rt_task_suspend(hrt_task)
Network read/write
Rt_task_resume(hrt_task)
.
.
.

To ensure the hard real time task is never activated while the network functions are at work. After using the suspend and resume the program does not crash anymore.


What above conflicts with the idea of real time. In fact if you can suspend a hard real time task to let a soft real time run, you are forcing a priority inversion, i.e allowing hard real time to be blocked by a not hardened task.
If it works the you do not need hard real time and stay happy with plain Linux.


My questions are

1.       is this is the right way to prevent a periodic real time task from interrupting another function?
One of the many possible,  but is a bit nonsensical.


2.       After suspending and resuming, is the task still in hard real time or do I need to make another call to make_hard_realtime()?
The hard real time state is not touched by a task suspend, whoever emits it.



3.       Should I use rt_task_make_periodic() instead of rt_task_resume()?
No.

Paolo


Thanks and Best Regards
Jonas

---------------------------
Jonas Schulze, M. Sc.
Technische Universität Darmstadt
Flugsysteme und Regelungstechnik
Otto-Berndt Straße 2
64287 Darmstadt, Germany

Tel.:      +49(0)6151/16-21077
Fax:      +49(0)6151/16-21050
E-Mail: [email protected]<mailto:[email protected]>
URL:     www.fsr.tu-darmstadt.de<http://www.fsr.tu-darmstadt.de>







_______________________________________________

Rtai mailing list

[email protected]<mailto:[email protected]>

https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
What above conflicts with the idea of real time. In fact if you can suspend a hard real time task to let a soft real time run, you are forcing a priority inversion, i.e allowing hard real time to be blocked by a not hardened task.
If it works the you do not need hard real time and stay happy with plain Linux.

_______________________________________________
Rtai mailing list
[email protected]
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.