Re: Reading and writing to a virtual file?
Originally Posted by
wrybread
Do you happen to know if it's bad practice to read and write to a file in tempfs multiple times per second?
Can anyone see a downside?
I do not think it is bad practice to use it.
For some tests I have been doing with shallow idle states, I have been passing tokens around some fifo files in /dev/shm at an average rate of 250,000 read/write cycles per second. About 10 hours per test, and I have done it maybe 50 times over a few months.
I do not see a downside.
Potentially interesting side note: The rate of token passing, for the 2 or more cross-core pair case, slows down by ~~50% over the 10 hours test. I have yet to figure out why.
EDIT (after the next two posts): My token passing work is done via named pipes, although I do also have a similar test that uses un-named pipes.
Code:
doug@s19:/run/user/1000$ doug@s19:/run/user/1000$ ls -l po*
prw-rw-r-- 1 doug doug 0 Oct 20 17:25 pong1
prw-rw-r-- 1 doug doug 0 Oct 20 17:25 pong10
doug@s19:/run/user/1000$ ls -F po*
pong1| pong10|
see also here.
Last edited by Doug S; October 21st, 2021 at 04:32 PM.
Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.
Bookmarks