Answer the question
In order to leave comments, you need to log in
How to run a function in multithread?
Hello.
For the first time I encountered multithreading. Tell me, how can I run 10 threads per 1 function?
The function does not work with external variables, no locks are needed.
The problem is that I don’t know how to correctly close the stream at the end of the program, but start the execution of the function again on a new one, or it would be better to close the stream and open a new one again to clear the memory.
Please advise how to implement this. Thanks a lot
Answer the question
In order to leave comments, you need to log in
https://docs.python.org/3/library/threading.html
https://docs.python.org/3/library/concurrent.futur...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question