I am wondering whether a sleep(1) is necessary in the following pseudo code.
My concern is that without the sleep(1), step 3 might not get the new content if the loop is executed really fast. However, with sleep(1), the code executed too slow. Furthermore, would such a high-frequent read/write of same file imposes a burden to the hard drive, or even affect other users on the server?
1. open a file, write new content to it, and close it
3. call a reader to read the file, and close it afterward.
All the best,