I'm completely new to C++ so bear with me. I have some code that someone else wrote
I'm a complete newbie to programming.
So... are you new to programming and you decided to begin by C++ with an undocumented multi-threading code written by somebody else? Is that right?
Wow, let me say I admire you. You really a brave guy. My best wishes.
Hope somebody else will come and help you, I'm a very beginner with multi-threading and I won't be of any help.
So... are you new to programming and you decided to begin by C++ with an undocumented multi-threading code written by somebody else? Is that right?
Wow, let me say I admire you. You really a brave guy. My best wishes.
Hope somebody else will come and help you, I'm a very beginner with multi-threading and I won't be of any help.
I could say the same thing. You don't show any efforts to begin with, and we also can't help someone who doesn't understand anything about C++ at all. Solutions will not help you learn and will likely encourage your laziness.
ok, why does sleep hang the thread? It should put the thread to sleep for 30 then wake up right where it left off. You can put a busy-wait in there, but that kills your performance... burns a cpu for nothing.
Edit : You need to keep your thread alive, not delete it.
nelwyn wrote:
I'm completely new to C++ so bear with me. I have some code written by someone else and I'm looking for a way to make it display something, then wait 30 seconds and display something different. Basically it's a 2 minute countdown with 30 second interval to say something.
The SystemBroadcast is what prints the message so I want a way to do this 4 times with a 30 second wait in between. The message will be different each time. I've only been able to do this with Sleep but obviously that's a bad thing as it will hang the thread.
This is the portion shown that I want to modify. If I need to include the whole thing, just let me know. Thanks.