Thread: Virtual Memory system

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    4

    Unhappy Virtual Memory system

    Can anybody help me on the construction of simple virtual memory system using C code. I would appreciate any comments, references, hints, any C material related to this topic, guides, etc

    Grateful for your kind attention
    Luís Dimas

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Make functions to send and fetch data from your "virtual memory". Basicly, file read and write functions. Make a function to check to see if the needed value is in memory. Make a function to do your comparison values. Vola. Virtual memory.

    An easy implementation is a double linked list. Make your list store X items. If there are more than X, page them to disk. If the value you're trying to find is not in memory, scan the disk for it. If it is, save one of the items in memory to disk, and load the item you need.

    Slightly improved upon this is a weighted list. The more common you request a particular piece of data, make it higher in the list so that it doesn't get swapped out as often.

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Virtual File system...random code
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 03-07-2005, 11:05 AM
  2. virtual memory program
    By funkylunch in forum Windows Programming
    Replies: 14
    Last Post: 12-04-2003, 11:15 AM
  3. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM
  4. compilation error - virtual memory exausted
    By yevgeny in forum C Programming
    Replies: 1
    Last Post: 11-19-2001, 12:59 PM
  5. Exporting Object Hierarchies from a DLL
    By andy668 in forum C++ Programming
    Replies: 0
    Last Post: 10-20-2001, 01:26 PM