|
You are going to need to break when the memory changes. Based on your description, my suspiscion is that something is writing to memory it doesn't own.
Do you have a pointer to the vector of pointers, or is this the actual object and its data element (the array of pointers) is going null at some point?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hello everyone,
I heard that page based I/O can improve performance, so some guys developed some page based I/O library which reads a file in page unit. For example, when we read the first byte, they will read an entire page (for example, 4k bytes) into memory, then when we are seeking to some other bytes inside a page, the bytes can be found from the page loaded in memory.
But, I also heard that when accessing OS File I/O, OS File I/O library implements page based I/O internally, for example, when you just read a byte using fseek or something, it will reads a whole page (maybe 4k or something) into memory.
My question is, which is true (OS provides page based I/O internally or not)? If OS provides page based I/O, why some guys always say that they are using page based I/O to improve performance.
thanks in advance,
George
|
|
|
|
|
This is one of those times where the code in question has been written and refined over many, many years. Improving hard drive access times is something that's always being improved. Let the OS and the hard drive do the cacheing for you.
If you want more details, search Channel9 for the interview with Molly Brown - she talks a lot about kernel mode memory and she discussed cacheing.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Thank you Michael!
Do you mean OS have already provide page based buffer functions?
regards,
George
|
|
|
|
|
In general, reading files in multiples of the disc sector size will offer a slight speed improvement. In the real world, an application has to be very disc bound to notice the difference since most hard drives and the OS itself do caching.
My own experience is that for streaming data, reading/writing files in multiples of the sector and page size, usually 32k chunks, offers the best performance.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi Joe,
Do you mean OS File system API does not provide page based buffer function internally and we have to read chunk by chunk (for example, 32k) by ourselves?
regards,
George
|
|
|
|
|
When you do a standard read the OS file system may or may not buffer the file data. It does so, however, at a very granular level. If you are streaming in and out large quantities of data, you can improve the performance by controlling this yourself. You can go even further and instruct the OS to not attempt any sort of caching, though you must ensure your buffers match the sector size of the hard disc.
I am speaking entirely in generalities. You will have to make the determination of how to handle your file data based on the requirements of your program. If speed is extremely important, you should try and benchmark different algorithms.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
So, the answer is "it depends" right? I am wondering whether there are any related resources (tutorials, ...) that I can make a reference about this topic. Any recommendations?
regards,
George
|
|
|
|
|
Hi
I have a property sheet with tabbed property pages
When the property sheet is opened up, depending on some user settings some pages
are not displayed
When the property sheet is created, i add all the pages
the in OnInitDaig, i remove the pages i dont need with
RemovePage(&m_Page1);
this works fine, if i only open the sheet up once
If i try to open again, i get an expection error on RemovePage line
anyone any ideas
thanks
si
|
|
|
|
|
si_69 wrote: If i try to open again, i get an expection error on RemovePage line
this is because you trying to remove the page which doesn't exist at all!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
How load a bitmap from bmp file at run time
|
|
|
|
|
::LoadBitmap and optional CBitmap::FromHandle can help.
|
|
|
|
|
Viorel. wrote: ::LoadBitmap and optional CBitmap::FromHandle can help.
you can't load Image from File using these function!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
You are right. The image can be loaded from separate file using ::LoadImage function with LR_LOADFROMFILE flag, as was answered by sujtha.
|
|
|
|
|
but LoadBitmap(bitmap resource);not file
whitesky
|
|
|
|
|
You are right. The image can be loaded from separate file using ::LoadImage function with LR_LOADFROMFILE flag, as was answered by sujtha.
|
|
|
|
|
Viorel. wrote: You are right. The image can be loaded from separate file using ::LoadImage function with LR_LOADFROMFILE flag, as was answered by sujtha.
Isn't i answered before Ms Sujtha ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ThatsAlok wrote: Isn't i answered before Ms Sujtha ?
Yes, I missed your message, sorry.
|
|
|
|
|
WhiteSky wrote: ut LoadBitmap(bitmap resource);not file
After long time i win the Leg Race
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi ThatsAlok, how are you,you are absent here !?
i think now you are very fast man not me and one thing where i write ut i write but
whitesky
|
|
|
|
|
WhiteSky wrote: i think now you are very fast man not me and one thing where i write ut i write but
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
anilksingh wrote: How load a bitmap from bmp file at run time
will LoadImage api help?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
LoadImage(NULL,szFilename, IMAGE_BITMAP,0,0, LR_LOADFROMFILE|LR_CREATEDIBSECTION);
|
|
|
|
|
<br />
(1) CImage m_Image;<br />
m_Image.Load(filename);<br />
-------------------------<br />
(2) CBitmap m_Bit;<br />
m_Bit.Attach((HBITMAP)::LoadImage(AfxGetResourceHandle(), <br />
filename,IMAGE_BITMAP,0, 0,LR_DEFAULTCOLOR |LR_LOADFROMFILE));<br />
whitesky
|
|
|
|
|
Since my application should handle different types of document with different toolbars , how can I make one toolbar visible or not after the user creates a new document or switches between documents of different types? Please, help me for it. Thanks
|
|
|
|