On 08/12/2010 12:56, Eric Fleming Bonilha wrote:
Since my app can have many handles and I need many sockets, I did many tests and found that procedure TIcsWndHandler.AllocateHWnd; create its own windows handle, instead of using classes.allocatehwnd How does this scheme works?
As I understood it, Classes.AllocateHWnd() is not thread-safe (or at least it wasn't in older Delphi versions). I think this was the primary reason why ICS had to avoid it and create its own thread-safe version.
I encountered the same problem when creating timers and other fancy things in a multi-threaded service some time ago.
I'm still stuck with Delphi 7 at the office, so I don't know if this has changed during the years. However, looking at the source code of TIcsWndControl.AllocateHWnd(), it appears that it's still locking the resource in order to create new handles. My guess is, no.
dZ. -- 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