Article View: borland.public.cppbuilder.nativeapi
Article #9597Re: Sleep() funtion in XP
From: Alan Bellingham
Date: Tue, 22 Jun 2004 09:30
Date: Tue, 22 Jun 2004 09:30
27 lines
2074 bytes
2074 bytes
"Francisco Villa" <nospam_francisco_destel@hotmail.com> wrote: >I undersatand that the thread suspend execution but there is much diference. Windows is really not suitable for real-time operations - it's not designed for it at all. >However this method consumes too much CPU %. A busy wait will do - that's why you should only use it if nothing else works. If the amount of CPU it uses is a problem, then it's likely that there's too much going on elsewhere for anything vaguely resembling real-time to work. However ... if you have a look at the Multimedia Timer area (timeSetEvent and so on), you should be able to get something far more precise, since that API has to support stuff that uses much shorter intervals at much more precise intervals. It won't be perfect (hey, even my dual Athlon machines won't play DVDs happily while I'm also doing multiple compiles and net downloads), but I guess it's what you should be trying for. Further advice I can't give - I've not actually done this myself. Alan Bellingham -- ACCU Conference 2005 - 20-23 April, Randolph Hotel, Oxford, UK
Technical Details
Message-ID:
<omufd0lfgp2acjj3tdca38ivdltppjodqq@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40d7dda3@newsgroups.borland.com> <40d7ecf1$1@newsgroups.borland.com> <40d7f263@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,78dca2a71f1a0ab4 X-Google-Attributes: gid10cc67,public From: Alan Bellingham <alanb@episys.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Sleep() funtion in XP Date: Tue, 22 Jun 2004 10:30:30 +0100 Reply-To: alanb@episys.com Message-ID: <omufd0lfgp2acjj3tdca38ivdltppjodqq@4ax.com> References: <40d7dda3@newsgroups.borland.com> <40d7ecf1$1@newsgroups.borland.com> <40d7f263@newsgroups.borland.com> X-Newsreader: Forte Agent 2.0/32.646 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 193.129.251.130 X-Trace: newsgroups.borland.com 1087896628 193.129.251.130 (22 Jun 2004 02:30:28 -0700) Lines: 27 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail