I have a .txt file with the lines login : password
I run the script, it parses the txt file(Parse CSV string) and enters the site using the login and password.
The problem is that if the script was launched, for example, in 4 threads, then in the case when there is one line of login:password has left (in the .txt), several threads will "grab" it at the same time.
As a result, I have several threads working with the same resource in parallel.
How can this be prevented?
I need that when one thread grabs one line from a txt file, then the other threads no longer touch this line.