Suspending and Resuming a hard real time task
Jonas Schulze <[email protected]>
| Newsgroups | gmane.linux.real-time.rtai |
|---|---|
| Message-ID | <9342DC0D76E23A4EA3F8BB9084C1AF571D7E6141@BREMEN.FSRNET.INTRANET.LOCAL> |
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. My questions are 1. is this is the right way to prevent a periodic real time task from interrupting another function? 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()? 3. Should I use rt_task_make_periodic() instead of rt_task_resume()? 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] https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai