×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Super Contributor
    Join Date
    Sep 2009
    Posts
    732

    Active Scheduler Stucks some times

    Hi Every one,
    i am usign s60 fp2 example C:\S60\devices\S60_3rd_FP2_SDK_v1.1\Examples\AppProts\exampleclient

    this example is to send request to http server and save the response on file.
    I am using post method and sending data manually but some times After calling
    CActiveScheduler::Start function it got stucks no response comes even i have put logs to code to check after starting scheduler which function get call but when every thing works fine it go to function void CHttpEventHandler::MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent)
    but when problem comes it stucks and never go to any function just hang up.
    can any one suggests me after starting active scheduler where it gets stucks
    Thanks & Regards
    Amit Kumar Mangal
    we can help each other and progress together
    http://amitmangal.blogspot.com/

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Active Scheduler Stucks some times

    I'm not familiar with the example, but calling CActiveScheduler::Start() in middle of application is generally a bad idea, better way would be to handle the active objects normally, and not try doing nested scheduling, since it can lead to situations that you are experiencing.

  3. #3
    Super Contributor
    Join Date
    Sep 2009
    Posts
    732

    Re: Active Scheduler Stucks some times

    Hi,
    Please tell me where should i call the scheduler and i didnt nothing this is an sdk example.
    I have one more scheduler in my example but that is working fine actually i have read many times about scheduler but still i don know how scheduler works and how to set up scheduler architecture.
    I putted logs at the starting of each fuction to know where it got stucks but when code stucks no function get call and event handler get call after CActiveScheduler::Start.
    And my application runs continuouslly 24 hours and i get this problems some times means more than 13 -14 hours.

    i want to curious to know about that after starting scheduler where control goes.
    cause in case of application running fine then it goes to CHttpEventHandler::MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent) but when application stucks where controls goes.
    If any one can tell me please tell me then i can do debug some thing.where control;s goes after calling CActiveScheduler::Start
    Thanks & Regards
    Amit Kumar Mangal
    we can help each other and progress together
    http://amitmangal.blogspot.com/

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,749

    Re: Active Scheduler Stucks some times

    That is normal, CActiveScheduler::Start intentionally starts an endless loop for handling and dispatching request completion events to the active objects. It returns from this loop when someone (an active object) invokes CActiveScheduler::Stop.
    Further reading with a pseudo-implementation: http://wiki.forum.nokia.com/index.php/Active_Scheduler

    Of course you can also check the real source code, though it is a bit harder to read: http://developer.symbian.org/xref/os...ase/ub_act.cpp

  5. #5
    Super Contributor
    Join Date
    Sep 2009
    Posts
    732

    Re: Active Scheduler Stucks some times

    can i start timer before calling ActiveScheduler::Start().so that this timer will check after 30 sec controls went to
    CHttpEventHandler::MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent) i will use one global flag and i will set this flag if controls went inside otherwise i will do activescheduler::stop in side Timer.
    is it possible ?
    Thanks & Regards
    Amit Kumar Mangal
    we can help each other and progress together
    http://amitmangal.blogspot.com/

  6. #6
    Super Contributor
    Join Date
    Sep 2009
    Posts
    732

    Re: Active Scheduler Stucks some times

    can i start timer before calling ActiveScheduler::Start().so that this timer will check after 30 sec controls went to
    CHttpEventHandler::MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent) i will use one global flag and i will set this flag if controls went inside otherwise i will do activescheduler::stop in side Timer.
    is it possible ?
    Thanks & Regards
    Amit Kumar Mangal
    we can help each other and progress together
    http://amitmangal.blogspot.com/

  7. #7
    Registered User
    Join Date
    Jan 2009
    Location
    India
    Posts
    143

    Re: Active Scheduler Stucks some times

    yes, it is possible..
    Regards,
    Gobi

  8. #8
    Super Contributor
    Join Date
    Sep 2009
    Posts
    732

    Re: Active Scheduler Stucks some times

    gobi_est,
    Thanks for reply please ghelp me start timer do u have some code snippet to add this ?
    Thanks & Regards
    Amit Kumar Mangal
    we can help each other and progress together
    http://amitmangal.blogspot.com/

  9. #9
    Registered User
    Join Date
    Jan 2009
    Location
    India
    Posts
    143

    Re: Active Scheduler Stucks some times

    add the following code in http sending method.

    and start the scheduler.

    Code:
    iPeriodic->Start(KTimeOutInterval, KTimeOutInterval, TCallBack(Start__,
    								this));
    being called once KTimeOutInterval reached

    Code:
    TInt CMyClass::Start__(TAny* aObject)
    	{
    	((CMyClass*) aObject)->StartL(); // cast, and call non-static function
    	return 1;
    	}
    
    void CMyClass::StartL()
    {
      /// do your coding here
    }
    	{

    I hope it will solve your problem
    Regards,
    Gobi

  10. #10
    Super Contributor
    Join Date
    Sep 2009
    Posts
    732

    Re: Active Scheduler Stucks some times

    Hi gobi_est,
    before calling ActiveScheduler::Start
    we will call this function
    iPeriodic->Start(KTimeOutInterval, KTimeOutInterval, TCallBack(Start__,
    this));
    Thanks & Regards
    Amit Kumar Mangal
    we can help each other and progress together
    http://amitmangal.blogspot.com/

  11. #11
    Registered User
    Join Date
    Jan 2009
    Location
    India
    Posts
    143

    Re: Active Scheduler Stucks some times

    we have to have one outstanding request before starting ActiveScheduler:: start


    At least one active object, with an outstanding request, must be added to the scheduler before the wait loop is started, otherwise no events will occur and the thread will hang, or any events that do occur will be counted as stray signals, raising a panic.
    Regards,
    Gobi

  12. #12
    Super Contributor
    Join Date
    Sep 2009
    Posts
    732

    Re: Active Scheduler Stucks some times

    you are very advance i dont have concept of active scheduler objects so i cannot get it can you please share email id ?
    Thanks & Regards
    Amit Kumar Mangal
    we can help each other and progress together
    http://amitmangal.blogspot.com/

  13. #13
    Super Contributor
    Join Date
    Sep 2009
    Posts
    732

    Re: Active Scheduler Stucks some times

    Gobi_est please help me to implement this logic what you are saying sounda very good but how to implement i dont know
    Thanks & Regards
    Amit Kumar Mangal
    we can help each other and progress together
    http://amitmangal.blogspot.com/

  14. #14
    Super Contributor
    Join Date
    Sep 2009
    Posts
    732

    Re: Active Scheduler Stucks some times

    Wizard_hu and symbianyucca please help to add timer before calling CActiveScheduler::Start. and how to stop scheduler in the timer function if the application is hangup?
    How to code i dont know please help me.
    Thanks & Regards
    Amit Kumar Mangal
    we can help each other and progress together
    http://amitmangal.blogspot.com/

  15. #15
    Registered User
    Join Date
    Feb 2012
    Posts
    6

    Re: Active Scheduler Stucks some times

    Hi All,

    Facing similar problem ,with minor differences like
    i am using

    iWaiter = new (ELeave) CActiveSchedulerWait();
    iWaiter->Start();

    but after some hours like 12-18 program gets stuck in MHFRunL(RHTTPTransaction aTransaction,const THTTPEvent& aEvent) and no other function gets ever called.

    Regards,
    Neha

Similar Threads

  1. Active Scheduler in a new thread
    By Daneel in forum Symbian
    Replies: 8
    Last Post: 2010-10-26, 07:35
  2. Run Symbian console app as a "daemon"
    By zumbo_oxinia in forum Symbian
    Replies: 6
    Last Post: 2010-01-20, 10:57
  3. Active Scheduler internals
    By kv.santosh in forum Symbian
    Replies: 2
    Last Post: 2009-02-23, 18:20
  4. Replies: 13
    Last Post: 2009-02-06, 11:56
  5. Active Object hogs active scheduler.
    By FloydFan in forum Symbian
    Replies: 4
    Last Post: 2005-09-29, 06:32

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×