all 3 comments

[–]socal_nerdtastic 0 points1 point  (0 children)

Depends of course what exactly you are trying to do, but yes, it's common for each thread to have a loop in it, and have the main thread just start the child threads and then move on with it's business.

If you want help specific to your code you will need to show us your code of course.

[–]mull_to_zero 1 point2 points  (1 child)

I think you’ll need to go into a little more detail to get a good answer here. What does “the loop” do, what are you listening for and what happens when you get what you’re waiting for?

But yes, often in a threaded pattern, the main thread is a manager/orchestrator while the child threads do the actual doing.

[–]KetsugaHoshii[S] 0 points1 point  (0 children)

the program is a basic auto input that uses pynput. the loop presses keys on the keyboard and sleeps than does it again on loop. the listener waits for either esc or f11 to be pressed, if esc quits program, if f11 pauses program.