Re: A question of writing file in rtlinux, thanks
Der Herr Hofrat <[email protected]> Sun, 13 Feb 2005 09:27:17 +0100 (CET)
| Newsgroups | gmane.linux.real-time.rtlinux.general |
|---|---|
| Message-ID | <[email protected]> |
> > Dear Everybody: > Nice to meet u in the web! > Now I'm using rtlinux/free v3.1 and I want to > write some data to a file once per 5 ms. I'm little > confused whether I can only use rtlinux's fifo/mbuff > or I can use some normal kernel function such as > "filp_open" or kernel side system call such as > "open/write"? > check out the examples in the 3.2 tree -> examples/kernel_resources/ you can write to a file directly using filp_open - but you must do it from kernel context - one way is to use a kernel thread that reads a buffer that is filled by the rt-task (thats quite fast actually). If you use fifos, note that they show the maximum bandwith with fairly small sizes (8kB in the last tests we did) so depending on the data volume this can be a sufficiently efficient solution (though with no check for lost data on the side of the fifo - you would have to implement such a check your self). moving data with mbuff is not as efficient as fifos - so you will generally use it if the data access patern is not simply a stream in which case fifos are more efficient. hofrat _______________________________________________ Rtl mailing list [email protected] http://www2.fsmlabs.com/mailman/listinfo/rtl