I Have a multithread application. Those all threads (depending on the connections number) append a text string to a text file, for instance a Log file. How do I syncronize them?
Thx
Xmas.
Printable View
I Have a multithread application. Those all threads (depending on the connections number) append a text string to a text file, for instance a Log file. How do I syncronize them?
Thx
Xmas.
I didn't check the link so it may explain it but the idea is that you don't want to an object to be changed at the sametime in two different threads. So if you perform an operation that requires a resource that the thread needs sole access to you can use SyncLock to have other threads halt or have only one thread access it at a time. It is 'locked' by that thread until its finished at which time other threads can go about their business.