I have built a web spider that is using Lucene to index the information.
However, when I implemented multi-threading, several threads are trying to write into the index at the same time, this generates an exception.
I assume the same happens with other cases, such as opening a file for writing with a thread, and then trying to access the file with another thread.
Could somebody provide some tips (code preferably) to avoid this thread conflicts or make the threads "wait" until the others have finished their job?
Thanks a lot!