Article View: borland.public.cppbuilder.nativeapi
Article #9415Re: Sleep() doesn't work as I'd expect
From: Chris Phillips
Date: Mon, 12 Jul 2004 08:57
Date: Mon, 12 Jul 2004 08:57
37 lines
2404 bytes
2404 bytes
That sort of works, but the main application now reports errors - what I am doing is retreiving a load of records from a database, and if I interrupt this with Application->ProcessMessages(), the database reports that it has lost it's cursor. Application->ProcessMessages() is the kind of call that I was looking for though, so thanks for that. I suppose that I could do with a call that only processes messages specific to the Comms thread. "Ron Sawyer" <XXXRSAWYER8128XQQXX@aol.com> wrote in message news:40efe85b@newsgroups.borland.com... > Try a call to Application->ProcessMesssages in the main program loop. > > > "Chris Phillips" <chris.phillips@corusgroup.com> wrote in message > news:40eea7bc@newsgroups.borland.com... > > > > I have an application with 3 threads to it. One thread is simply > processing > > serial IO but must run close to real-time - I have given it priority > > tpTimeCritical. This thread is executed by the main program. However, if > > the main program is doing something processor intensive (such as > retreiving > > a number of database records), then my Comms thread doesn't get a look in > > until the processor intensive part has finished. I have put a Sleep > command > > into the processor intensive loop thinking that it will allow the Comms > > thread to continue with its stuff, but to no avail. > > > > Any suggestions? > > > >
Technical Details
Message-ID:
<40f25261$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40eea7bc@newsgroups.borland.com> <40efe85b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,f4373c97b27dc766 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Chris Phillips" <chris.phillips@corusgroup.com> From: "Chris Phillips" <chris.phillips@corusgroup.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <40eea7bc@newsgroups.borland.com> <40efe85b@newsgroups.borland.com> Subject: Re: Sleep() doesn't work as I'd expect Date: Mon, 12 Jul 2004 09:57:05 +0100 Lines: 39 Organization: Corus X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4922.1500 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4939.300 NNTP-Posting-Host: 145.8.171.20 Message-ID: <40f25261$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1089622625 145.8.171.20 (12 Jul 2004 01:57:05 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail