Thread: how does cacheing, indexing, checksums and memory management works?

  1. #1
    Registered User
    Join Date
    Apr 2002

    how does cacheing, indexing, checksums and memory management works?


    say forexample i created a very big file to stuff in all my say 1000's bmps graphic files.

    how do i memory manage it? since i can't load all of them at once as it will consume all my computer memory. How does cacheing works? checksum? what is it for?

    also, is indexing like, i'd go through my very big file, not loading anything but just getting all th bmps' name as well as the offsets of my various bmps from the beginning of the very big file, and just storing them on a table/list or something? then later on, when i need something, since i'll just go through my list and then set my file pointer to the offset on the list? is this what indexing is all about? so in short, i shuould do this rather than, reading the whole resource file while whenever i'm looking for something.

    many thanks!

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Visalia, CA, USA
    I assumed that you were going to be asking a deeper question by reading the subject. You are in luck my friend, I have written some AVI readers this experience should help you in what you are doing. Many AVI's have an index at the end of a segment that maps where each frame will be. So you if keep a memory record of where one picture would be in a file and would use a c function like tell() or ftell() or the gtell() or the c++ istream::tellg() to go directly to a certain place in a file.

    Memory management, in a nutshell, is using a limited amount of memory to accomplish many tasks.

    Checksums are a sort of failsafe system that makes sure that nothing is wrong with the data being processed. For example many compression algorithms have a checksum put into their files so that the decoder knows if the data is corrupted or not.

    Caching is an ambiguous term that describes moving data somewhere else until it is needed again. Most programs cache out data by writing the large, but unnecessary data to a file.

  3. #3
    Registered User
    Join Date
    Oct 2002
    Is caching something you do yourself or is it done by the OS.
    If you have to generate the code, how will it then look like. (If it's not, too, big)
    Well english isn't my first language, (it's instead a useless language called danish which only 5 milion people speak!!) so if you think my grammar SUCKS (it does by the way) than you're more then welcome to correct me.
    Hell I might even learn something

  4. #4
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    >Is caching something you do yourself or is it done by the OS.

    It can be either. Every wondered what virtual memory is? When you run out of physical memory, your OS (if configured to do so) will start using the disk as memory.

  5. #5
    Registered User
    Join Date
    Apr 2002
    master5001: so am right? it's a table/list of all the datas/lumps inside a big file so later on, you could just reposition the file pointer to anywhere you want? so probably the list would look like this,

    filename1 = offset
    filename2 = offset

    is this what winxp does? there's an option when you go and search for a file on the windows explorer, you could index the file so next time it'll be faster, is this what winxp does? make a table/list of all the files?

    err, is checksum == crc check? ehm, checksum is used to MAKE SURE NOTHING IS WRONG with the data being processed? how?

    many thanks,

Popular pages Recent additions subscribe to a feed