> I wonder when it is safe to define NO_ADV_MT. > > Must I not define NO_ADV_MT at all when I use threads? > > What if I use a socketserver in one thread and another socketserver in > another thread and there is no interaction between the threads? The client > connections always stays within the threads. > > Or, what if I use a httpcli in one thread, and a another httpcli in another > thread, and there is no interaction between the threads?
it is safe to define NO_ADV_MT when a TWSocket instance is use from a single thread only. Every call to method, every property use, every event handler must be run within the context of the same thread (either the creation thread or any other thread after calling ThreadAttach). No problem to have an instance in one thread and another instance in another thread. IMO it is better design to have all access to a given component from only one thread. And in that case, you can define NO_ADV_MT to have better performances because you avoid using a critical section. The usual case where no must not define NO_ADV_MT is when you have a TWSocket created (or attached) in a thread context and having call to Send and Receive from other threads. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be