SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TThread->Suspend conflict???

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
Hermit



Joined: 12 May 2004
Posts: 8
Location: Poland

PostPosted: Wed May 12, 2004 9:55 am    Post subject: TThread->Suspend conflict??? Reply with quote

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:
myThread->Resume();


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

Code:
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:
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
Back to top
View user's profile Send private message Visit poster's website
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2095

PostPosted: Thu May 13, 2004 5:13 am    Post subject: Reply with quote

Does removing TsiLang components solves the problem? I believe - not. It definitely looks like there is problem somewhere in your code.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group