Click here to Skip to main content
15,897,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi

I have an app. which works with windows timer in c++

i want to use it as a slave in another app. but the master app. is sequential.

In the master app. we declare that 1 second passed after completing all the necessary

calculations (the actual time can be a lot less or a lot more)

In the slave app. there is a real timer which its duration is 1 second
What i want to do is in the master app. when it decided that 1 second passed it should send some kind of an event to the slave which will cause its timer reach its duration and activate the timer callback

The apps communicate through UDP

Thanks!

What I have tried:

Some messing around with SetWaitableTime but with no results
Posted
Updated 21-Mar-18 7:07am

1 solution

Where is the problem?

You already have an IPC (Inter Process Communication). Let the master send a specific package to the slave which then acts accordingly (calls the callback function and optionally stops or restarts the timer). The package implementation is referred to as protocol.
 
Share this answer
 
Comments
dj4400 26-Mar-18 9:57am    
The problem is that the both the master and the slave do time based actions
When a specific period of time passed then the master sends a package and when a different period of time passed the slave sends a package. What i want is not to depend on time, but to run as fast as possible - when the master finished its calculations and it can send the package i want it to send the package, and the time for both the master and the slave will be as if the required period of time passed
Jochen Arndt 26-Mar-18 14:16pm    
All you need are stoppable timers and events that stop them.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900