Article View: borland.public.cppbuilder.nativeapi
Article #14715Re: Threads and Timer problem
From: Phuoc Can HUA
Date: Mon, 04 Aug 2003 01:04
Date: Mon, 04 Aug 2003 01:04
38 lines
2287 bytes
2287 bytes
As far as I know, if you use Synchronize() it will lose the Thread effect,
because it will wait until the main() to process that function.
For some situations you need Synchronize() though. When I was using 2
Threads and drawing some graphics. For some reasons, the program keeps on
crashing, even with semaphores, until I use Synchronize(), of course then
it will be on hold while doing graphic operations, but at least the
calculation can be done in thread.
HTH
Phuoc Can HUA
On Sun, 3 Aug 2003 16:34:45 -0800, Paul E. <paulepst69@aol.com> wrote:
> I've developed an application that must process few function every 1-5
> seconds, unfortunately when I run the application it is very slow and
> dramatically use a lot of the system resources, so I thought of making a
> thread that can handle this time based operation in my application as the
> code below shows, but still the application is very slow and it uses a
> lot
> of the system resources...can anyone give me any idea on how to speed up
> the
> process...optimize my thread....and is my code correct or I am missing
> anything...??? thanks all for your help
>
> void __fastcall TIMConnection::Execute()
> {
> while(Terminated==false)
> {
> Synchronize(RUNME1);
> Close();
> }
> }
--
_/\__/\__/\__/\__/\__/\_
www.huaonline.com
My Homepage is my Castle
Technical Details
Message-ID:
<oprtcvw7ssbq7az6@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f2daa27@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,ece7f64e3f770b72
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-03 18:11:50 PST
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Threads and Timer problem
References: <3f2daa27@newsgroups.borland.com>
Message-ID: <oprtcvw7ssbq7az6@newsgroups.borland.com>
Content-Type: text/plain; charset=iso-8859-15; format=flowed
From: Phuoc Can HUA <home}a+t{huaonline.com>
MIME-Version: 1.0
Date: Mon, 04 Aug 2003 11:04:09 +1000
User-Agent: Opera7.10/Win32 M2 build 2840
NNTP-Posting-Host: 210.9.89.210
X-Trace: newsgroups.borland.com 1059959299 210.9.89.210 (3 Aug 2003 18:08:19 -0700)
Lines: 38
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail