Re: rt_make_soft_real_time hangs my process
Paolo Mantegazza <[email protected]>
| Newsgroups | gmane.linux.real-time.rtai |
|---|---|
| Message-ID | <HE1PR06MB1465A602E7E4A5A9B170C7F190590@HE1PR06MB1465.eurprd06.prod.outlook.com> |
Trivially recalling that Linux threads are substantially processes sharing a memory space by default, every thread of a process can be made hard-soft as you like, under RTAI. So if you have a thread that in Linux's hands to acquire frames through a not hard real time RTAI driver and want that as soon as a complete frame has been acquired it is process in hard real time immediately you have just to enable (using rt_thread_init or rt_task_init_schmod) the acquisition LINUX thread to using RTAI functions, mating it to another hard real time hardened RTAI thread that waits for being awaken by the acuisition thread. That done define a multiple frames buffer, let the acquisition frame acquire frames continuously passing an available frame index to the hard real time thread. The mechanisms to be used can be just a semephore with the index being a per process variable, a suspend-resum, an rpc_receive with the index passed through and rt_send. Hoping I undertood your proble, sorry if my suggestions were trivial stuff. Paolo ________________________________________ From: Duane AW. Jeffery [[email protected]] Sent: Friday, June 3, 2016 6:54 PM To: Paolo Mantegazza; '[email protected]' Subject: RE: rt_make_soft_real_time hangs my process Its running on a video processing software, and we're doing it to ensure our image analysis routine is not interrupted. Each time a new frame arrives from the camera, it goes hard, processes the frame, and returns soft. Framerates range from 100 to ~9000 fps depending on ROI. I think I might know what's going on though. The process that this runs on creates a separate thread for acquiring the frames from the camera with its affinity set so that it runs on a separate core, and the realtime part is only for the processing of a frame after it arrived. Both functions run under the same process though (ie. ps aux only shows one item), and so I think that might be my problem. Can I even legally call rt_make_hard_real_time() on a multithreaded process? -Duane -----Original Message----- From: Paolo Mantegazza [mailto:[email protected]] Sent: Friday, June 03, 2016 9:59 AM To: Duane AW. Jeffery <[email protected]>; '[email protected]' <[email protected]> Subject: RE: rt_make_soft_real_time hangs my process Can you provide the frequency of the hard7soft switches? If you a doing it for a controlled approach to Linux syscalls , try letting RTAI take care of it and see what happens. In such a view you might even try using a Linux server . That said, eventually this is the case in which it should not be too complex to set a neutral test up, so that I cantry to diagnose the problem you are wittnessing. Paolo ________________________________________ From: Rtai [[email protected]] on behalf of Duane AW. Jeffery [[email protected]] Sent: Friday, June 3, 2016 3:12 PM To: '[email protected]' Subject: [Rtai] rt_make_soft_real_time hangs my process Hi all, I'm running a shiny new system on Linux 4.1.18 w/ RTAI 5 from vulcano, and it seems to be going well. (System is derived from a Slackware 14.1 install) I seem to be having a small problem with one of my applications where it calls into rt_make_soft_real_time() which never returns. It previously calls rt_make_hard_real_time(), and calls the pair in a loop, so it switches back and forth fairly frequently. Any ideas? -Duane _______________________________________________ Rtai mailing list [email protected] https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai