Activity object Framework II: Activity object and activity Scheduler

Source: Internet
Author: User

The event is scheduled by the activity scheduler.

Events are handled by activity objects.


Activity object

* It can be used to process asynchronous function responses.
* Derived from cactive (all activity objects are derived directly or indirectly from cactive)
* Contains
-A trequeststatus base class member variable istatus, which is used to pass in asynchronous Functions
-Runl () function, called after the request is complete
-Docancel () function, called when the request is canceled
-Priority: used to determine the call priority.


Activity Scheduler

* For a GUI program, after the program is started, the operating system will create an activity Scheduler

* The activity scheduler runs in the main thread of the application.

* You can customize the activity scheduler by yourself, but each thread can have only one activity Scheduler

* Running mode of the activity Scheduler

-Synchronization is waiting for unfinished requests to be completed

-Check the registered activity object by priority and check whether there are incomplete requests or whether the requests have been completed (istatus! = Kpequestpending)

-After the activity Object Request is complete, runl () can be called.

-Other requests can be checked only when runl () is returned.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.