Article View: borland.public.cppbuilder.nativeapi
Article #13765Re: TThread
From: Blue Knight
Date: Fri, 12 Sep 2003 00:24
Date: Fri, 12 Sep 2003 00:24
33 lines
1976 bytes
1976 bytes
Hi Andy, I suspect that a more likely scenario could be that your thread isn't releasing it's timeslice at all and is taking up all the processor time. Try adding in some ::Sleep(n) instructions (particular within loops), where n is a number of milliseconds - I typically use 0, 50, 100, 250, 500, or 1000, depending on what the thread is designed to do. Regards, Bevan "Andy" <andyholcomb@comcast.net> wrote in message news:3f60e4dc$1@newsgroups.borland.com... > > I am tring to create a thread that will run in the background, so if someone clicks a stop button on the main form it will reset info that was changed during the thread execution and then terminate. I am using the Create New Thread Object Method. I seam to have a working thread, but my program seams to be waiting for the completion of the thread before it goes on. I can't even move my form. > > I am using this line to start the thread on a button click > > TestItThread = new TthreadTest(false); > > Should I do it a different way? > > I am using BCB4 > > Thanks Andy >
Technical Details
Message-ID:
<3f611222$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f60e4dc$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,b3bd84980f619f6 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-09-11 17:26:33 PST From: "Blue Knight" <bevan231X@Xhotmail.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f60e4dc$1@newsgroups.borland.com> Subject: Re: TThread Date: Fri, 12 Sep 2003 12:24:03 +1200 Lines: 35 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 210.55.223.31 Message-ID: <3f611222$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1063326242 210.55.223.31 (11 Sep 2003 17:24:02 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail