Click here to Skip to main content
16,014,476 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to search a large text file quicker Pin
Tim Smith7-Mar-03 10:25
Tim Smith7-Mar-03 10:25 
GeneralRe: How to search a large text file quicker Pin
dazinith7-Mar-03 11:00
dazinith7-Mar-03 11:00 
GeneralRe: How to search a large text file quicker Pin
Tim Smith7-Mar-03 11:44
Tim Smith7-Mar-03 11:44 
AnswerRe: How to search a large text file quicker Pin
Ted Ferenc8-Mar-03 2:02
Ted Ferenc8-Mar-03 2:02 
GeneralDShow-implementing CBaseControlWindow Pin
Jakub Misek7-Mar-03 9:36
Jakub Misek7-Mar-03 9:36 
QuestionCompliers and File IO buffer efficiency? Pin
phyzics7-Mar-03 9:12
phyzics7-Mar-03 9:12 
AnswerRe: Compliers and File IO buffer efficiency? Pin
Tim Smith7-Mar-03 9:22
Tim Smith7-Mar-03 9:22 
GeneralHelp With Threads...PLEASE! Pin
dantan987-Mar-03 7:57
dantan987-Mar-03 7:57 
Confused | :confused: Mad | :mad: Eek! | :eek: Dead | X|
I am having major thread problems in my application.

I am trying to set up our program so the threads don't run into each other (access the same file at the same time) and so they don't wait on each other forever.

I have been working on this for 2 weeks now and am nearly suicidal because it isn't working. I need a solution to replace what I have now. Please read everything below and respond if you are able to help out.

This is in a Doc/View structure. Basically, I need to know where to create the threads, what I should use for syncrhonization, where to wait, and where to set the threads/events/etc. as signalled. Thank you so much for your help!!

--Dan

/\/\/\

Right now, we have a thread for Action-S, for Action-A, and for Action-C.

Action-S accesses a file in memory and then updates a physical file.

Action-A accesses the same file in memory and updates a local file.

Action-C accesses the same physical file as Action-S and then locks down the main thread until a process is finished (the lockdown works fine - I don't need to worry about that).

All Action-S's and Action-A's only care about the actions for a particular file name. If the file "xyz" is open, Action-A for "xyz" does not care about what is happening for file abc (such as an Action-A for "abc").

For one file only, please refer to this diagram...

L P
\ / \
A\ S/ C\
\ / \
M W

"A" - Action-A (performs M then L)
"S" - Action-S (performs M then P)
"C" - Action-C (performs P then W)
"L" - Local File
"M" - File in Memory
"P" - Physical File
"W" - Process to Wait On.

"\" - a Thread
"/" - a Thread
GeneralRe: Help With Threads...PLEASE! Pin
dantan987-Mar-03 7:59
dantan987-Mar-03 7:59 
GeneralRe: Help With Threads...PLEASE! Pin
AlexO7-Mar-03 8:16
AlexO7-Mar-03 8:16 
GeneralRe: Help With Threads...PLEASE! Pin
dantan987-Mar-03 8:34
dantan987-Mar-03 8:34 
GeneralRe: Help With Threads...PLEASE! Pin
AlexO7-Mar-03 9:28
AlexO7-Mar-03 9:28 
GeneralRe: Help With Threads...PLEASE! Pin
Scott H. Settlemier7-Mar-03 9:59
Scott H. Settlemier7-Mar-03 9:59 
GeneralRe: Help With Threads...PLEASE! Pin
Neville Franks7-Mar-03 10:26
Neville Franks7-Mar-03 10:26 
GeneralRe: Help With Threads...PLEASE! Pin
Scott H. Settlemier7-Mar-03 11:27
Scott H. Settlemier7-Mar-03 11:27 
GeneralRe: Help With Threads...PLEASE! Pin
AlexO7-Mar-03 10:45
AlexO7-Mar-03 10:45 
GeneralOpen a Text File on SDI (Listview) Project Pin
Member 2693577-Mar-03 7:07
Member 2693577-Mar-03 7:07 
GeneralRe: Open a Text File on SDI (Listview) Project Pin
RobJones7-Mar-03 7:19
RobJones7-Mar-03 7:19 
GeneralRe: Open a Text File on SDI (Listview) Project Pin
7-Mar-03 9:55
suss7-Mar-03 9:55 
GeneralRe: Open a Text File on SDI (Listview) Project Pin
RobJones7-Mar-03 10:23
RobJones7-Mar-03 10:23 
Generalpreventing from copying Pin
_ra7-Mar-03 5:50
_ra7-Mar-03 5:50 
GeneralRe: preventing from copying Pin
AlexO7-Mar-03 6:07
AlexO7-Mar-03 6:07 
GeneralRe: preventing from copying Pin
Alvaro Mendez7-Mar-03 6:08
Alvaro Mendez7-Mar-03 6:08 
GeneralRe: preventing from copying Pin
Navin7-Mar-03 6:42
Navin7-Mar-03 6:42 
GeneralRe: preventing from copying Pin
_ra7-Mar-03 7:18
_ra7-Mar-03 7:18 

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.