- Регистрация
- 29.03.2011
- Сообщения
- 221
- Благодарностей
- 30
- Баллы
- 0
With a template that runs on e.g. 40 threads, but they use the same resource files (e.g. accounts.txt) what do I have to do, to make sure, these threads don't mess with the file?
I know if two threads try to write to the same file, there's a file block for the second (and following thread).
Is it the same for reading? get files blocked on reading?
And if a step encounters a file block, it will fail. So I have to loop it to try again, right?
Can I wait less than a second (pause -1-) before looping?
I know if two threads try to write to the same file, there's a file block for the second (and following thread).
Is it the same for reading? get files blocked on reading?
And if a step encounters a file block, it will fail. So I have to loop it to try again, right?
Can I wait less than a second (pause -1-) before looping?
, there will be enough time for another thread to pick the same line ( which will nmess up the all thing), if u only delete the line after getting the last bit u need. just take the all string delete imediatly and then that string stays in memory, use split the result of that to get the several bits, but the line was long way gone from the file on the first step...