Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Best way to Write and read from a file Pin
Dennis Gourjii23-Feb-06 2:56
Dennis Gourjii23-Feb-06 2:56 
JokeRe: Best way to Write and read from a file Pin
James R. Twine23-Feb-06 2:33
James R. Twine23-Feb-06 2:33 
GeneralRe: Best way to Write and read from a file Pin
Dennis Gourjii23-Feb-06 2:50
Dennis Gourjii23-Feb-06 2:50 
JokeRe: Best way to Write and read from a file Pin
James R. Twine23-Feb-06 3:28
James R. Twine23-Feb-06 3:28 
GeneralRe: Best way to Write and read from a file Pin
Dennis Gourjii23-Feb-06 3:45
Dennis Gourjii23-Feb-06 3:45 
AnswerRe: Best way to Write and read from a file Pin
James R. Twine23-Feb-06 4:51
James R. Twine23-Feb-06 4:51 
AnswerRe: Best way to Write and read from a file Pin
Wim Engberts23-Feb-06 5:01
Wim Engberts23-Feb-06 5:01 
GeneralRe: Best way to Write and read from a file Pin
fearless stallion23-Feb-06 19:03
fearless stallion23-Feb-06 19:03 
Thanks willam,

Let me put it a bit more clearly,

The primary thread of my application or the main thread launches the second worker thread when it is initialized. the second thread runs in the background and after every 6 seconds looks for a file say "abcd.txt" where records are written. now records to this file are written from the primary thread. and this writing can take place at any moment the enduser wishes. say at a particular moment the secondary thread is reading the file and the enduser writes to it at that particular moment than the data read from the file will be corrupt. that is what my problem is. i don't want to deny the end user ,rather i would like to keep him waiting for a second or two and then once the read is complete, i would like to write into the file. and give him a success message.

The critical section point that james made above sounds nice. but if you have any other suggestion then please let me know.

One more question , is it a good idea, reading from a file every 6 seconds?Sniff | :^)

kss
GeneralRe: Best way to Write and read from a file Pin
Wim Engberts23-Feb-06 23:17
Wim Engberts23-Feb-06 23:17 
GeneralRe: Best way to Write and read from a file Pin
fearless stallion24-Feb-06 1:17
fearless stallion24-Feb-06 1:17 
AnswerRe: ListCtrl Pin
James R. Twine23-Feb-06 4:55
James R. Twine23-Feb-06 4:55 
QuestionOverwriting in the console Pin
Cedric Moonen22-Feb-06 23:59
Cedric Moonen22-Feb-06 23:59 
AnswerRe: Overwriting in the console Pin
divine_augustine8423-Feb-06 0:11
divine_augustine8423-Feb-06 0:11 
GeneralRe: Overwriting in the console Pin
toxcct23-Feb-06 0:13
toxcct23-Feb-06 0:13 
AnswerRe: Overwriting in the console Pin
toxcct23-Feb-06 0:12
toxcct23-Feb-06 0:12 
GeneralRe: Overwriting in the console Pin
Wim Engberts23-Feb-06 0:16
Wim Engberts23-Feb-06 0:16 
GeneralRe: Overwriting in the console Pin
toxcct23-Feb-06 0:17
toxcct23-Feb-06 0:17 
AnswerRe: Overwriting in the console Pin
toxcct23-Feb-06 0:25
toxcct23-Feb-06 0:25 
AnswerRe: Overwriting in the console Pin
Cedric Moonen23-Feb-06 0:49
Cedric Moonen23-Feb-06 0:49 
QuestionPrinting directly without dialog box Pin
LapinGarou22-Feb-06 23:53
LapinGarou22-Feb-06 23:53 
AnswerRe: Printing directly without dialog box Pin
Cool Ju23-Feb-06 0:08
Cool Ju23-Feb-06 0:08 
GeneralRe: Printing directly without dialog box Pin
LapinGarou24-Feb-06 22:49
LapinGarou24-Feb-06 22:49 
QuestionHow to get mac address from specical IP? Pin
Rulala22-Feb-06 23:14
Rulala22-Feb-06 23:14 
QuestionPC/SC in C++ Builder Pin
kittymew22-Feb-06 23:07
kittymew22-Feb-06 23:07 
Questionoperator () overloading. Pin
9ine22-Feb-06 23:00
9ine22-Feb-06 23:00 

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.