I figured out my issue - the thread never deatched or joined. On a completely unrelated note, is it considered bad programming to have an infinite while loop in a thread?
I consider myself as an enthusiast in learning new things everyday, about our history and future as well as the present. My interests: Ancient History, Comparative Religion, Science and Tech, C++
If your thread doesn't go to sleep mode because of waiting for I/O or probably waiting for a result, then
definitely you have to put a sleep to make sure the thread doesn't hog the cpu.
You can have a 50ms or 100ms (millisecond) sleep time when you are executing the infinite loop.
However, there are certain OS calls which automatically puts the thread to sleep mode to be activate later, in that case putting a manual sleep is not necessary.
Depending on the situation, having an infinite loop in a thread is not a bad thing, as long as you ensure you send the thread a message through an event or setting off a variable to quit when the main program quits.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I figured out my issue - the thread never deatched or joined. On a completely unrelated note, is it considered bad programming to have an infinite while loop in a thread?
If your thread doesn't go to sleep mode because of waiting for I/O or probably waiting for a result, then
definitely you have to put a sleep to make sure the thread doesn't hog the cpu.
You can have a 50ms or 100ms (millisecond) sleep time when you are executing the infinite loop.
However, there are certain OS calls which automatically puts the thread to sleep mode to be activate later, in that case putting a manual sleep is not necessary.
Depending on the situation, having an infinite loop in a thread is not a bad thing, as long as you ensure you send the thread a message through an event or setting off a variable to quit when the main program quits.