×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2013
    Posts
    73

    Question about Thread

    I found a thread class template.
    http://developer.nokia.com/Community...eading_example


    But unlike threads on windows, here i must define interval between thread ticks.

    I just wonder, when my thread will be still running and another tick comes around, will it be terminated or the thread will wait until first tick is finished?

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: Question about Thread

    The example shows two things:
    - threading, which happens like anywhere else
    - using an Active Scheduler in a secondary thread, with a timer as example - that is what you are asking about.
    The main timer class is RTimer, it operates with a single TRequestStatus, so it is suitable for wrapping into an active object. When you do not want to implement a complete active object, you can consider inheriting from some pre-defined wrappers. CPeriodic is the wrapper which simply invokes a callback function periodically. It is not meant to be precise, and it will skip invocations if the callback method runs long. An other variant is CHeartbeat, this one will detect when it skips an invocation.
    Wrapping a timer to a secondary thread is not a good idea in general, as you normally have an Active Scheduler in the primary thread already, and it can host the timer.
    Note that the SDK-s contain simple asynchronous examples, look for Fibonacci1-2-3 (the location is SDK-dependent, but it is in the GUI-less examples folder, in older days they were in examples\base\ipc\async. Fibonacci1 calculates Fibonacci numbers synchronously, Fibonacci2 shows the thing wrapped into a thread, and Fibonacci3 shows the thing with an active object.

  3. #3
    Registered User
    Join Date
    Jul 2013
    Posts
    73

    Re: Question about Thread

    Found it, thanks.

Similar Threads

  1. one question about multi-thread
    By schmeichel in forum Symbian
    Replies: 2
    Last Post: 2010-06-21, 11:27
  2. Might be old question in new Thread
    By gamerrajan in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2008-08-15, 13:14
  3. New to this thread. Question regarding S60
    By donbalon in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2005-11-08, 20:05
  4. Thread question
    By nexis2600 in forum Symbian
    Replies: 1
    Last Post: 2003-12-11, 16:02
  5. Thread question
    By SpaceCowboy in forum Mobile Java General
    Replies: 4
    Last Post: 2003-10-08, 08:13

Posting Permissions

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