Hi all,
I'm looking for a simple java example of a multithread server that creates a number of threads that open and write the same file in a synchronized way.
Can someone link an example or write a sample code? Google didnt help me
Doesn't really matter what you do with it. Simply search for thread synchronization in Java.
All you need to do is control the condition of the wait and notify so that when one thread is writing to the file it blocks all other threads from opening until its finished. When done, notify so that another thread can pick it up.