Click here to Skip to main content
15,905,867 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Word automation question Pin
Stuart Dootson13-Aug-09 5:11
professionalStuart Dootson13-Aug-09 5:11 
GeneralRe: Word automation question Pin
sashoalm13-Aug-09 5:35
sashoalm13-Aug-09 5:35 
GeneralRe: Word automation question Pin
Stuart Dootson13-Aug-09 22:17
professionalStuart Dootson13-Aug-09 22:17 
QuestionStatic pointer Pin
kumar sanghvi13-Aug-09 4:22
kumar sanghvi13-Aug-09 4:22 
AnswerRe: Static pointer Pin
Cedric Moonen13-Aug-09 4:29
Cedric Moonen13-Aug-09 4:29 
GeneralRe: Static pointer Pin
kumar sanghvi13-Aug-09 5:03
kumar sanghvi13-Aug-09 5:03 
GeneralRe: Static pointer Pin
sashoalm13-Aug-09 21:00
sashoalm13-Aug-09 21:00 
QuestionSequencing or queuing parallel process [modified] Pin
s v joshi13-Aug-09 3:36
s v joshi13-Aug-09 3:36 
Please help to solve these scenario of process waiting for execution in C++
Scenario is as follows
There is one parent process say P1 and 4 child processes say A B C D
Process A starts at 3:00 pm
Process B starts at 3:15 pm
Process C starts at 3:30 pm
Process D starts at 3:45 pm

Process A take 1 hour for completion and process B,C,D takes
10 mins for completion
At a time only one process is allowed to execute since
these process shared some common resources so at any point of time
only one process is allowed to execute. but these are scheduled job so
process B, C, and D must wait till process A get completes

so process B must wait till 4:00 PM for execution
and starts at 4:00 PM
process C must start at 4:10 PM after completion of process A and B
process D must start at 4:20 PM after completion of process A and B and C
so these sequencing also should maintained

B, C and D cannot start unless and until A is get completed and user dose not know how much time A will take so B,C and D must wait for completion of A and after A completes then and then only B,C and D execute in a same order

so how to implement wait mechanism for this scenario ?

Currently i have implemented a lock mechanism where first process A will create a lock file and process B,C and D will continuously poll this lock file and as soon as process A finishes it will release a lock on and whichever process acquires a lock first will get executed first but here sequencing is not maintained and process executes randomly

so what kernel objects like event, semaphore are needed to solve this scenario.
Where to store data (simple command line) when this process are waiting ?
How to maintain a sequence for excutation ?

please help to solve this scenario of process waiting for execution

-Thanks

modified on Thursday, August 13, 2009 9:46 AM

AnswerRe: Sequencing or queuing parallel process Pin
Iain Clarke, Warrior Programmer13-Aug-09 4:10
Iain Clarke, Warrior Programmer13-Aug-09 4:10 
AnswerRe: Sequencing or queuing parallel process Pin
Stuart Dootson13-Aug-09 5:09
professionalStuart Dootson13-Aug-09 5:09 
QuestionCFileDialog::HideControl() broken Pin
softwaremonkey13-Aug-09 2:47
softwaremonkey13-Aug-09 2:47 
AnswerRe: CFileDialog::HideControl() broken PinPopular
Stuart Dootson13-Aug-09 3:25
professionalStuart Dootson13-Aug-09 3:25 
GeneralRe: CFileDialog::HideControl() broken Pin
softwaremonkey13-Aug-09 4:30
softwaremonkey13-Aug-09 4:30 
AnswerRe: CFileDialog::HideControl() broken Pin
Iain Clarke, Warrior Programmer13-Aug-09 3:52
Iain Clarke, Warrior Programmer13-Aug-09 3:52 
QuestionStrange runtime behavior without breakpoint Pin
Tomas(cz)13-Aug-09 0:55
Tomas(cz)13-Aug-09 0:55 
AnswerRe: Strange runtime behavior without breakpoint Pin
Code-o-mat13-Aug-09 2:07
Code-o-mat13-Aug-09 2:07 
GeneralRe: Strange runtime behavior without breakpoint Pin
Tomas(cz)13-Aug-09 3:41
Tomas(cz)13-Aug-09 3:41 
QuestionCapture inactive desktop in windows Pin
Stifly13-Aug-09 0:36
Stifly13-Aug-09 0:36 
AnswerRe: Capture inactive desktop in windows Pin
Code-o-mat13-Aug-09 6:57
Code-o-mat13-Aug-09 6:57 
QuestionRandom Name Generator Pin
Chuck Vought13-Aug-09 0:30
Chuck Vought13-Aug-09 0:30 
QuestionRe: Random Name Generator Pin
CPallini13-Aug-09 0:55
mveCPallini13-Aug-09 0:55 
AnswerRe: Random Name Generator Pin
Chuck Vought13-Aug-09 2:11
Chuck Vought13-Aug-09 2:11 
GeneralRe: Random Name Generator Pin
CPallini13-Aug-09 2:31
mveCPallini13-Aug-09 2:31 
GeneralRe: Random Name Generator Pin
Chuck Vought13-Aug-09 3:10
Chuck Vought13-Aug-09 3:10 
General[Message Deleted] Pin
Chuck Vought13-Aug-09 4:17
Chuck Vought13-Aug-09 4:17 

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.