TThread->Suspend conflict???

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
Hermit
Posts: 8
Joined: Wed May 12, 2004 8:46 am
Location: Poland
Contact:

TThread->Suspend conflict???

Post by Hermit »

I've a problem with CPU utilization.

After added tsiComponents to my app something strange happend with thread executing (code without tsilang works propertly).

Resuming thread is called 8 times per second by:

Code: Select all

myThread->Resume();
CPU enter into infinitive loop in myThread::Execute() even in such simple function as below:

Code: Select all

void __fastcall TOggComponent::Execute()
{
  while (!Terminated)
  {
    CanLink = true;
    Suspend();
  }//end while (!Terminated)
}

Problem is connected with suspending thread - it does't free CPU but rerun execute method (WITHOUT WAITING FOR CALLING RESUME). It works like (pseudocode below):

Code: Select all

void __fastcall TOggComponent::Execute()
{
  while(1)
  {
    while (!Terminated)
    {
      CanLink = true;
      Suspend();
    }//end while (!Terminated)
  }
}
Any of the functions calling inside Execute() don't interact with any of tsilang component (on the other hand) - calling execute body as non threaded function works propertly.

I've BCB 6.0 Prof + SP2 & TsiLang Demo Component 5.2.5

thanks for help
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Does removing TsiLang components solves the problem? I believe - not. It definitely looks like there is problem somewhere in your code.
Post Reply