🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13640

Thread problem.

#13640
From: Bogdan
Date: Wed, 01 Oct 2003 18:43
35 lines
1661 bytes
I have a function that renders a Direct3D scene.If I call this function
periodically through a timer everything works ok.But if I put the same
function in a thread the application stops responding, or responds with
a lot of delay, to its own messages(mouse clicks, movement).The thread
has TP_NORMAL priority, and the function is called using the Synchronize
method.

Here's some sample code:
In the thread:

void __fastcall TRenderThread::Execute()
{
 while(!Terminated)
 {
  Synchronize(f);
 };
};

where f  is:

void __fastcall TRenderThread::f(void)
{
 Render();
};

And, using a timer:

void __fastcall TMainForm::TimerTimer(TObject *Sender)
{
 Render();
}

Render is the function that renders the Direct3D scene.

Bogdan.
Technical Details
Message-ID: <3f7b216f@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!sn-xit-02!sn-xit-06!sn-xit-05!sn-xit-08!supernews.com!newsfeeds.sol.net!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,41aab54595cffc86,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-01 12:09:54 PST
From: "Bogdan" <boprea@xnet.ro>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Thread problem.
Date: Wed, 1 Oct 2003 21:43:40 +0300
Lines: 41
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 213.233.88.119
Message-ID: <3f7b216f@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1065034095 213.233.88.119 (1 Oct 2003 11:48:15 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!sn-xit-02!sn-xit-06!sn-xit-05!sn-xit-08!supernews.com!newsfeeds.sol.net!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail