Saturday, June 23, 2012

Active Scheduler in Symbian

We know, what is Active Scheduler and what is the role in symbian ...
Now ,I wanted to explain ,why we are creating Active Scheduler for all the thread , why can't we have only one Active Scheduler  for all the thread ..

Ok, I'll explain multithreading application with single Active scheduler, at the end  you will come to know where the problem starts and why we are creating Activescheduler per Thread.

Active Scheduler contains 2 Active object both are requested from each thread.

Now 
1. AO1 is running ,Thread1 cycle is completed before completing the RunL() of the AO1
2. Now , Thread2's time to execute , and AO2's request has completed .
3. since AO1 is not completed ,Active scheduler won't start AO2  execution

    see , here we are wasting Thread2's cycle . and AS wont start AO2 until and unless AO1 is completed.

In case , If we have AS per thread , then there is no wastage of cycle.

Hope now you understand why we need to create AS for each Thread.





No comments:

Post a Comment