0

Function gen() generates a string, which is a command to be passed into os.system().

I need to start 20 threads at the same time, call gen() for each thread, and run the command gen() gives me in each thread. (parallel)

Once a command finishes executing in a thread, I want to call gen() again to generate another command, and run that command in the same thread.

I want to to keep doing this until 10 minutes have passed.

How do I do this?

1 Answer 1

1

Take a look at this, hope this helps.

Its actually not that hard

but keep in mind when working with threads which use the same variable to use locks!

Sign up to request clarification or add additional context in comments.

2 Comments

This actually helped, Thanks.
If there is no better answer, I'll accept this tomorrow. Thanks again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.