in reply to Re^2: Keeping MySQL connection parameters in a safe place
in thread Keeping MySQL connection parameters in a safe place

Now, if I have a text file with the word 'soup' in it. And I have an infinite loop that makes a system call to a script that reads the content into memory and then exits.. . Are you saying at some point the text file will be coming from memory instead of disk ?!

What if it's an infinite loop and it's spaced at a random 1 to 10 seconds appart?

  • Comment on Re^3: Keeping MySQL connection parameters in a safe place

Replies are listed 'Best First'.
Re^4: Keeping MySQL connection parameters in a safe place
by tirwhan (Abbot) on Dec 28, 2005 at 16:00 UTC

    Not only that, but if you have a process that opens the file, performs tr/ua/au/ on the content and writes it back, exits and starts again, then chances are most of these actions will never touch the disk but rather be performed entirely in RAM. Changed content will be written out to disk eventually of course, but that happens largely asynchronously to your activities and it's likely to be at a time when your OS isn't busy with the disk anyway and the disk is in a good state to perform the write. Assuming you're on a decent OS.

    There are a number of parameters which influence how and when this will happen, such as frequency of the read/writes, general memory pressure on the system, disk activity, the filesystem used and also mount options (on *NIX you can mount disks in sync mode which ensures that data is written out to disk almost immediately, this can obviously slow down the system a lot).

    See this text for some more details on how this is done on Linux.


    A computer is a state machine. Threads are for people who can't program state machines. -- Alan Cox