Article View: borland.public.cppbuilder.nativeapi
Article #1992Re: Win32 Semaphores in TThread?
From: Dennis Jones
Date: Fri, 25 May 2007 16:45
Date: Fri, 25 May 2007 16:45
21 lines
2053 bytes
2053 bytes
"Jonathan Benedicto" <invalid@nobody.com> wrote in message news:45f5f1ba$1@newsgroups.borland.com... > Bob Gonder wrote: >> But don't you want the MainThread to do the drawing since it owns the >> canvas? >> That's why I mentioned TThread::Synchronize( &Display ); > > No, because that would penalize the speed. Ideally, the video thread > should perform the rendering, you just can't use SetDIBitsToDevice as it > is not thread-safe. Depends on where the speed is needed. If processing speed is more important than rendering speed, then an alternative to Synchronize would be to have the processing thread post 'render' messages to the message queue and let the main thread process those messages (and perform the rendering) whenever it can. This would allow the grabbing/processing thread to perform as fast as possible while still allowing rendering to occur in the main thread without resorting to a Synchronize call. - Dennis
Technical Details
Message-ID:
<465712c2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<45f57403@newsgroups.borland.com> <45f59a06$1@newsgroups.borland.com> <45f59b82$1@newsgroups.borland.com> <0hqbv2dprchfsm2or89k36blc5p3ukhu25@4ax.com> <45f5f1ba$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,411b13b57e2ea81a X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Dennis Jones" <nospam@nospam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <45f57403@newsgroups.borland.com> <45f59a06$1@newsgroups.borland.com> <45f59b82$1@newsgroups.borland.com> <0hqbv2dprchfsm2or89k36blc5p3ukhu25@4ax.com> <45f5f1ba$1@newsgroups.borland.com> Subject: Re: Win32 Semaphores in TThread? Date: Fri, 25 May 2007 09:45:55 -0700 Lines: 23 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 71.245.109.58 Message-ID: <465712c2$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1180111554 71.245.109.58 (25 May 2007 09:45:54 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail