Hello, I need a program that calls out some code after every x milliseconds and in the same time it waits for keyboard strokes to change the interval time and code what is called out. I should use threads (one for waiting for keyboard input and others for intervalled wake-ups). I need real multi-threading because more than 3 sequences will be called out in the same time.
Using the threads there may be need for complicated thread synchronization? Important is that the App is CPU thrifty (sparing). There are some timer functions which freezes the whole cpu. So how to make safe multi-threading and which function should I use to get those intervals /sleep()?/ and also to get the keystrokes?
My real time application should take control over MIDI device.
P4, Win XP, Visual C++.
Thanks in advance.
experimenter
0
Newbie Poster
Recommended Answers
Jump to PostDon't expect to get very accurate timeings in the threads because XP (or any other version of MS-Windows or *.nix) is not a real-time operating system. So if you expect an event to happen in exactly X milliseconds it probably won't happen. Probably the best you can hope for is …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.