Re: [twsocket] FTP Client in a separate thread
> Do you see similar (strange delays or high CPU use) with IE or any > other internet application as well? Delays, yes. CPU use, no. But that is an interesting idea, I could try the same thing on different PCs. IE has its own problems. Applications that depend on IE can stall each other. For example, as long as StarMoney is working on the freshly imported bank data, Internet Explorer cannot open a new window or tab. Sometimes StarMoney needs several minutes after getting data from my banks, and during that time I need to use FireFox if I want to browse web sites. Cheers, Tobias -- 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
Re: [twsocket] FTP Client in a separate thread
Tobias Giesen wrote: > Hello, > > thanks for the suggestions, Arno and Francois! > > I will try it using ASync calls. I tried ftpWaitUsingSleep but it does > not make any difference. > > But the problem is not a CPU concurrency problem. It is much worse. > The main thread calls PeekMessage (in TApplication.ProcessMessage) and > Windows does not return from this call for a minute or so!! How on > earth can that be ... the worker thread's priority is already tpLower. Strange. > > And everything works fine as long as I copy files locally, but as > soon as I use FTP or HTTP or even SSH with any library (ICS, Indy, > SecureBlackBox, Clever Internet Suite) the main process stalls. So are you saying that it's not a problem related to ICS only? Do you see similar (strange delays or high CPU use) with IE or any other internet application as well? -- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html > Cheers, > Tobias -- 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
Re: [twsocket] FTP Client in a separate thread
Hello, thanks for the suggestions, Arno and Francois! I will try it using ASync calls. I tried ftpWaitUsingSleep but it does not make any difference. But the problem is not a CPU concurrency problem. It is much worse. The main thread calls PeekMessage (in TApplication.ProcessMessage) and Windows does not return from this call for a minute or so!! How on earth can that be ... the worker thread's priority is already tpLower. And everything works fine as long as I copy files locally, but as soon as I use FTP or HTTP or even SSH with any library (ICS, Indy, SecureBlackBox, Clever Internet Suite) the main process stalls. Cheers, Tobias -- 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
Re: [twsocket] FTP Client in a separate thread
> after some successful years with ICS I am now trying to do some FTP > transfers in a separate thread. Everything happens in the thread, > including the FTPClient component creation. The thread itself uses > the synchronous commands, for example FTPClient.Get. > > I am currently using ICSV6 (OverbyteIcsFtpCli.pas V2.108). > > My problem is that this separate thread makes my application very > unresponsive. The main application thread seems to be almost totally > blocked and responds to messages, such as moving or drawing the > main window, only after big delays. Avoid using sync methods when using a thread. You'll eat up CPU for nothing. Use pure async operation. > Am I missing something very basic here? Does anybody have an idea? Be sure to create your component from the thread's Execute method and /not/ from the thread constructor or your events will be handled by the main thread ! (Not an ICS issue, but simply the way Windows is working). Aslo, if you have a very fast network, such as a GigaBit Ethernet, it is well possible that your transfer become a CPU bound task. You'll solve the problem by lowering the priority of your worker thread but of course this will slow down transfers. Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) 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
Re: [twsocket] FTP Client in a separate thread
Tobias Giesen wrote: > Everything happens in the thread, Just to clear this up, you have to create the TFtpClient instance method Execute of TThread. Otherwise it won't realy run in the thread. -- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- 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
Re: [twsocket] FTP Client in a separate thread
Tobias Giesen wrote: > > My problem is that this separate thread makes my application very > unresponsive. The main application thread seems to be almost totally > blocked and responds to messages, such as moving or drawing the > main window, only after big delays. How is option ftpWaitUsingSleep set? Can you try to change this to either True or False? I've no experience with the sync-methods since I'm using async methods, in worker threads successfully as well. If that doesn't change anything you could try to lower thread's priority, just an idea. -- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- 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