Article View: borland.public.cppbuilder.nativeapi
Article #348Re: Moving hooke callback to thread - suggestions? (was:Hooks, once again)
From: Anders Johansen
Date: Thu, 08 May 2008 16:13
Date: Thu, 08 May 2008 16:13
25 lines
1841 bytes
1841 bytes
Bob Gonder <notbg@notmindspring.invalid> wrote:
>Anders Johansen wrote:
>
>>The problem is however that if you include this code in a program that blocks the message processing loop
>> (say, by doing while (true) {};)
>
>Don't do that!
>Never put that kind of code in the main thread.
Well, sure :D
But the problem is not a deadlock - it is cases where you
might be doing things that block the message loop temporarily,
such as playing a WAV file without using asynchronous dispatch
of sound. This would make the mouse jitter.
>>This is why I expect that moving the event processing etc.
>> to another thread is a Good Idea.
>
>No, moving blocking code to another thread is a Good Idea.
Yes, if you can find it :D
A
Technical Details
Message-ID:
<4823269e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<47c935cb$1@newsgroups.borland.com> <48217905$1@newsgroups.borland.com> <24c3249pbvhtdcpjihmskrvr9pisljt7g6@4ax.com> <4822c89f$1@newsgroups.borland.com> <3056249n55n21hr9aeq4di1130seokqia4@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4ebd883022a89a5d X-Google-Attributes: gid10cc67,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Anders Johansen" <home@dduck.dk> Sender: "Anders Johansen" <home@dduck.dk> Reply-To: "Anders Johansen" <home@dduck.dk> Subject: Re: Moving hooke callback to thread - suggestions? (was:Hooks, once again) Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 90.184.163.204 References: <47c935cb$1@newsgroups.borland.com> <48217905$1@newsgroups.borland.com> <24c3249pbvhtdcpjihmskrvr9pisljt7g6@4ax.com> <4822c89f$1@newsgroups.borland.com> <3056249n55n21hr9aeq4di1130seokqia4@4ax.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <4823269e$1@newsgroups.borland.com> Date: 8 May 2008 09:13:18 -0700 X-Trace: newsgroups.borland.com 1210263198 207.105.83.66 (8 May 2008 09:13:18 -0700) Lines: 25 Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail X-Original-Bytes: 1681