SYMBIAN OS Development Primary Manual 9 Active Object Basic Concepts October 30, 2004, I told the use of multiple threads in Symbian OS, which we talk about the use of more frequent frames in Symbian OS: Active Object (hereinafter referred to as AO). Multithreading is very wide in traditional programs, but it is not necessarily a superior selection on small devices with limited resources. Through the class, we see that each thread is to assign a certain memory. If all asynchronous operations are made through multithreading, the system is a small burden. The AO design is to handle asynchronous operations within the same thread. AO is working in the coordination of ActivesCheduler (AS). When an AO is asked, the request function returns immediately, AO can continue to run, or wait. After the asynchronous operation is completed, the AS will notify, then it calls the Runl function in the corresponding AO. So the universal usage of AO is to create a request function to the asynchronous operation and then process the results of the operation in RUNL. For example: We have a socket, you need to read some data from the network and then output, then we need: a request function: void myao :: RequestReceive () {isocket.recv (IBUF, ..., iStatus);} Runl: void myao :: runl () {iconsole-> Printf (ipuf);} When using this AO, you can call RequestRecEive () first, then continue to do other things, when Socket is read, AS will call this AO. Runl, then accepted data will be printed. Of course, we must actually use AO in the program. We also need to learn a lot. At this point you only need to have a conceptual understanding of AO. The following is a picture that is turned over in Newlc, and basically hits the framework of Active Object:
Article Source: http://symbian.org.cn/bbs/viewtopic.php? T = 933