Is it possible to implement a real-time API to read the files on the disk?

Wolfgang Denk wd at denx.de
Thu Jan 14 17:55:33 CET 2021


Dear 孙世龙 sunshilong,

In message <CAAvDm6ZsQwrFoLfjnespyx65cmzWgYXGk=dyUE_UD5-dAUKaNQ at mail.gmail.com> you wrote:
>
> >You can guarantee _average_ data for I/O to storage devices, like a
> >guaranteed sustained throughput (*), but you will not be able to
> >guarantee any hard real-time behaviour (like latencies or such).
> It seems that real-time OS could not guarantee a hard real-time
> behaviour for reading files.
>
> Two more questions arise:
> 1. A lot of real-time applications based on Xenomai have to meet this
>  problem (i.e reading files), how do you solve it?
> Reading files by non-rt thread and sending the data(or the pointer to
> the data) to the rt thread by XDDP?

Yes, use another task (process or thread).

> 2.Can I draw the conclusion that there is no real-time OS that could
> guarantee a hard real-time behaviour for reading?

Thisis correct, assuming "reading" means reading from conventional
rotating hard disks, SSD drives or any other kind of NAND flash
based storage devices (USB sticks, eMMC, SDCard, CompactFlash
etc.).  None of these devices guarantee any RT capabilites (*).

(*) As far as I can tell; there may be special models with
alternative firmware which is tailored for RT responses -
technically that would be possible, but I have never seen any such
thing, and a quick search on your favorite search engine comes up
empty.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It may be bad manners to talk with your mouth full, but it isn't  too
good either if you speak when your head is empty.



More information about the Xenomai mailing list