Click here to Skip to main content
15,922,533 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Calling a COM interface from a worker thread Pin
Stuart Dootson13-Aug-09 21:07
professionalStuart Dootson13-Aug-09 21:07 
GeneralRe: Calling a COM interface from a worker thread Pin
Stuart Dootson14-Aug-09 2:08
professionalStuart Dootson14-Aug-09 2:08 
QuestionHow to log visited URLs Pin
televes13-Aug-09 5:51
televes13-Aug-09 5:51 
AnswerRe: How to log visited URLs [modified] Pin
Bacon Ultimate Cheeseburger13-Aug-09 12:12
Bacon Ultimate Cheeseburger13-Aug-09 12:12 
JokeRe: How to log visited URLs Pin
Moak13-Aug-09 13:43
Moak13-Aug-09 13:43 
GeneralRe: How to log visited URLs Pin
televes14-Aug-09 10:51
televes14-Aug-09 10:51 
AnswerRe: How to log visited URLs Pin
kilt17-Aug-09 3:36
kilt17-Aug-09 3:36 
GeneralMSI installation: problem when Norton Antivirus is active Pin
VictorSotnikov13-Aug-09 5:47
VictorSotnikov13-Aug-09 5:47 
GeneralRe: MSI installation: problem when Norton Antivirus is active Pin
Bacon Ultimate Cheeseburger13-Aug-09 16:11
Bacon Ultimate Cheeseburger13-Aug-09 16:11 
Questionrand() causing unresolved external symbol Pin
Member 321680813-Aug-09 5:05
Member 321680813-Aug-09 5:05 
AnswerRe: rand() causing unresolved external symbol Pin
Stuart Dootson13-Aug-09 5:17
professionalStuart Dootson13-Aug-09 5:17 
GeneralRe: rand() causing unresolved external symbol Pin
Member 321680813-Aug-09 5:25
Member 321680813-Aug-09 5:25 
QuestionRe: rand() causing unresolved external symbol Pin
Randor 13-Aug-09 12:56
professional Randor 13-Aug-09 12:56 
AnswerRe: rand() causing unresolved external symbol Pin
Member 321680814-Aug-09 3:27
Member 321680814-Aug-09 3:27 
QuestionWord automation question Pin
sashoalm13-Aug-09 4:54
sashoalm13-Aug-09 4:54 
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 

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.