🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #15329

Re: SetEventTimer routine holds TThread task?

#15329
From: Phuoc Can HUA
Date: Wed, 09 Jul 2003 23:04
38 lines
2556 bytes
On Tue, 8 Jul 2003 22:22:31 -0700, Remy Lebeau (TeamB) <gambit47@yahoo.com> 
wrote:

>
> "Phuoc Can HUA" <home}a+t{huaonline.com> wrote in message
> news:oprr0lg5y5bq7az6@newsgroups.borland.com...
>
> That was a little TOO much code to post.
Sorry, about that. But I have already tried to minimize it.

>> void CALLBACK      LocalDisplay::Refresh( UINT uID, UINT uMsg, DWORD
>> dwUser, DWORD dw1, DWORD dw2)
> You can't use a class member method as the callback, unless the method is
> declared as 'static'.  Otherwise You have to use a standalone function
> instead.
Yes, it's static (I think that was one of your advices some time ago, 
thanks) :-)

>> for(;;)
>
> If I had to guess, your loop is most likely running too tightly, eating 
> up
> the CPU cycles.  Try putting a Sleep() in it to make it yield control
> periodically so the CPU can do other things.
I'll try to put Sleep() in the timer routine. Although that for(;;) 
shouldn't take too much time because as soon as the message queue is empty 
it will leave the loop and there are not too many messages coming in.

I was also thinking that the for(;;) in the TThread (MIDI) is causing 
problem. I have tried to put Sleep() between those MIDI events. But it 
didn't help  :-(

Phuoc Can HUA

-- 
_/\__/\__/\__/\__/\__/\_
www.huaonline.com
My Homepage is my Castle
Technical Details
Message-ID: <oprr2fp2ihbq7az6@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <oprrwu2pcgbq7az6@newsgroups.borland.com> <3f08d164@newsgroups.borland.com> <oprrxfa6dpbq7az6@newsgroups.borland.com> <3f09295c@newsgroups.borland.com> <oprr0lg5y5bq7az6@newsgroups.borland.com> <3f0ba574$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,a436a021eb0521f3
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-09 16:09:39 PST
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: SetEventTimer routine holds TThread task?
References: <oprrwu2pcgbq7az6@newsgroups.borland.com> <3f08d164@newsgroups.borland.com> <oprrxfa6dpbq7az6@newsgroups.borland.com> <3f09295c@newsgroups.borland.com> <oprr0lg5y5bq7az6@newsgroups.borland.com> <3f0ba574$1@newsgroups.borland.com>
Message-ID: <oprr2fp2ihbq7az6@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: Thu, 10 Jul 2003 09:04:40 +1000
User-Agent: Opera7.10/Win32 M2 build 2840
NNTP-Posting-Host: 210.9.89.210
X-Trace: newsgroups.borland.com 1057792074 210.9.89.210 (9 Jul 2003 16:07:54 -0700)
Lines: 38
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail