D
David Pendrey
Greetings all!
I am writing a program which will contain a large amount of information
which is saved onto disk and read into objects as it is required. Because of
the size of information I need to create a buffer for it rather than having
everything loaded at once. Unfortunatly data access is random and the
information needs to be kept for random periods of time (anything between 10
clock ticks and 10 hours).
I saw a great method of handling this kind of buffering once in visual
basic... Each object keeps track of how many variables it is stored in, and
once that value reaches zero the object is unloaded from memory by the
garbage collector. This VB code decremented this counter by one, so once
only the buffer had a copy of the object it was unloaded. To me this seems
like the optimal solution, I don't have to keep track of when data isn't
being used anymore, just load the data when it's not in the cache.
Can anyone point me in the right direction for implementing this in C#, so
far I've been unable to figure out how to do it myself.
Regards, Dave
I am writing a program which will contain a large amount of information
which is saved onto disk and read into objects as it is required. Because of
the size of information I need to create a buffer for it rather than having
everything loaded at once. Unfortunatly data access is random and the
information needs to be kept for random periods of time (anything between 10
clock ticks and 10 hours).
I saw a great method of handling this kind of buffering once in visual
basic... Each object keeps track of how many variables it is stored in, and
once that value reaches zero the object is unloaded from memory by the
garbage collector. This VB code decremented this counter by one, so once
only the buffer had a copy of the object it was unloaded. To me this seems
like the optimal solution, I don't have to keep track of when data isn't
being used anymore, just load the data when it's not in the cache.
Can anyone point me in the right direction for implementing this in C#, so
far I've been unable to figure out how to do it myself.
Regards, Dave