Click here to Skip to main content
15,902,635 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Always write to top of file Pin
Richard MacCutchan11-Dec-13 2:38
mveRichard MacCutchan11-Dec-13 2:38 
GeneralRe: Always write to top of file Pin
Grahamfff11-Dec-13 4:04
Grahamfff11-Dec-13 4:04 
GeneralRe: Always write to top of file Pin
Richard MacCutchan11-Dec-13 4:57
mveRichard MacCutchan11-Dec-13 4:57 
GeneralRe: Always write to top of file Pin
enhzflep11-Dec-13 4:58
enhzflep11-Dec-13 4:58 
AnswerRe: Always write to top of file Pin
Eugen Podsypalnikov11-Dec-13 2:26
Eugen Podsypalnikov11-Dec-13 2:26 
QuestionRe: Always write to top of file Pin
David Crow11-Dec-13 5:15
David Crow11-Dec-13 5:15 
AnswerRe: Always write to top of file Pin
Grahamfff11-Dec-13 5:22
Grahamfff11-Dec-13 5:22 
GeneralRe: Always write to top of file Pin
Stefan_Lang15-Dec-13 23:23
Stefan_Lang15-Dec-13 23:23 
Grahamfff wrote:
They are recoverery data files,

Now, finally, you are providing some useful info.

First off, the file system is a bottleneck. The only way to speed up file access is use a different file system. But you probably don't have that choice.

Second, repeatedly writing to hard disk in a fixed time loop every 20ms is an incredibly stupid idea, for various reasons - this is simply not the intended purpose of a file system! You should consider different storage media, depending an what is available to you, or you should consider to just wait longer between writes. I'm not an expert on this, but Flash drives, SRAM, or even USB may be more suitable. (Although writing to flash drives 50 times per second is a sure way to destroy them in short order...)

Third, I can't think of any reason to write recovery info more often then once every couple of seconds: a recovery feature usually means the ability to restore a state that is difficult to reproduce, either because it is the result of interacting with a non-deterministic system (such as a human), or because there is no other way to reproduce the data (e. g. in very long range communication such as talking to mars rovers and the like). Either way, losing the data from as little a timespan as one second is meaningless! OTOH, if for whatever incomprehensible reason you really, really need that info stored every 0.02s flawlessly, then the file system simply is too slow to reliably do this - not to mention that trying it will slow your entire application to a crawl. As suggested above, use a different storage medium!
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

AnswerRe: Always write to top of file Pin
Alan Balkany11-Dec-13 5:27
Alan Balkany11-Dec-13 5:27 
Questionapp for windows 8.1 Pin
Member 1045927510-Dec-13 22:32
Member 1045927510-Dec-13 22:32 
AnswerRe: app for windows 8.1 Pin
Richard MacCutchan11-Dec-13 0:23
mveRichard MacCutchan11-Dec-13 0:23 
AnswerRe: app for windows 8.1 Pin
Erudite_Eric11-Dec-13 1:57
Erudite_Eric11-Dec-13 1:57 
QuestionGet rid of STL warnings Pin
_Flaviu10-Dec-13 21:58
_Flaviu10-Dec-13 21:58 
SuggestionRe: Get rid of STL warnings Pin
Richard MacCutchan10-Dec-13 22:23
mveRichard MacCutchan10-Dec-13 22:23 
AnswerRe: Get rid of STL warnings Pin
Freak3010-Dec-13 23:01
Freak3010-Dec-13 23:01 
GeneralRe: Get rid of STL warnings Pin
_Flaviu11-Dec-13 2:37
_Flaviu11-Dec-13 2:37 
SuggestionRe: Get rid of STL warnings Pin
David Crow11-Dec-13 5:19
David Crow11-Dec-13 5:19 
QuestionTrying to reuse code with a static library Pin
Richard Andrew x648-Dec-13 19:21
professionalRichard Andrew x648-Dec-13 19:21 
AnswerRe: Trying to reuse code with a static library Pin
Richard MacCutchan8-Dec-13 22:24
mveRichard MacCutchan8-Dec-13 22:24 
AnswerRe: Trying to reuse code with a static library Pin
Albert Holguin9-Dec-13 5:23
professionalAlbert Holguin9-Dec-13 5:23 
GeneralRe: Trying to reuse code with a static library Pin
Richard Andrew x649-Dec-13 6:35
professionalRichard Andrew x649-Dec-13 6:35 
GeneralRe: Trying to reuse code with a static library Pin
Albert Holguin9-Dec-13 6:43
professionalAlbert Holguin9-Dec-13 6:43 
AnswerRe: Trying to reuse code with a static library Pin
Gisle Vanem9-Dec-13 22:59
Gisle Vanem9-Dec-13 22:59 
QuestionMissing Button Click Message Pin
BarryPearlman8-Dec-13 8:50
BarryPearlman8-Dec-13 8:50 
QuestionRe: Missing Button Click Message Pin
Richard MacCutchan8-Dec-13 22:21
mveRichard MacCutchan8-Dec-13 22:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.