Hi Przemek First of all I must say you are right, this code isn't thread safe: lInUse := ! lInUse
But i've also said its only a simplification. In a real program this code: 1- goes inside a sync method of a class 2- the logical var does not exit 3- the array is a var of the class 4- the class is referenced by in a Public var My intention was to show you that any manipulation of a public var must be enclosed by some kind of semaphore ( be it implemented as a sync method, mutex or logical var) Excuse me, such loose sample I gave you. Any code you want compiled and tested in xbase++ just send it to me and I'll be glad to report the results back to you. Angel -- View this message in context: http://www.nabble.com/A-few-questions-about-MT-tp19555409p19680697.html Sent from the Harbour - Dev mailing list archive at Nabble.com. _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour