Anton Sviridov wrote:
> Hello!
> I'm writing multithreaded VCL application with following structure:
> - one thread holding a number of sockets receiving data
> - one server thread to provide remote control
> - one main TApplication thread, of course
> All actions with sockets are done within their owner thread.
> 
> All inter-thread stuff is synchronized by events, PostMessage is used
> where possible, so I think no issues here. 
> 
> The question: do I need ADV_MT enabled (i.e., NO_ADV_MT defined)? It
> generates lots of locking/unlocking, which I think are excess in my
> case. Or it's safer to leave the define as is?

If you have instances of TWSocket or descendant in different threads do
not define NO_ADV_MT. The SSL code also relies on that symbol.
However the locking around the winsock library calls are IMO wasted
processor time. This is necessary only to provide a public library 
unload option which is IMO not required. Why would I want to unload 
a loaded library except on application shutdown? 
Possible race conditions on checking whether DLL handle or procedure addresses 
were assigned or not won't hurt if the library was only
unloaded on application shutdown, or am I missing the point?

--
Arno Garrels 


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to