IO event loop parsing and libevio event parsing in libev
1. Basic data structure of IO events ev_io
Struct ev_io this struct is an IO monitor. All events in libev have their own struct, such as ev_time and ev_io.
The base class ev_watcher is defined as follows:
typedef struct ev_watcher{ int active; int pending; int priority; void *data; void (*cb)(struct ev_loop *loop, struct ev_watcher *w, int revents);}
In the base class, "acti
processed will be checked and executed:
1) returned from a hardware interrupt code
2) In the ksoftirqd kernel thread
3) in the code that explicitly checks and executes the Soft Interrupt to be processed, such as the network subsystem
The Soft Interrupt should be executed in the do_softirq () function:
Asmlinkage void do_softirq (void)
{
_ U32 pending;
Unsigned long flags;
If (in_interrupt ())
Return;
Local_irq_save (flags );
The representation of the signal in the kernelThe processing action of the signal is called the signal recursion (Delivery), the signal from the generation to the state between the recursion, called signal Pending (Pending). A process can choose to block (block) a signal. When the blocked signal is generated, it remains in the pending state until the process has
in the business is too small, in the short term in the social media and the ontology service providers, can not see Google's breakthrough point, These services must have a sufficient user base to be effective. I personally think the next possible breakthrough lies in the Android platform, but I'm afraid it still depends on the killer apps outside the maps. Google has a very big difficulty in information integration: How do you implement the concatenation of variable-current information? This is
, the social gaming company that created the miracle of gardening, valued as much as $9 billion trillion, and Twitter, the founder of the unprofitable microblog, was said to be worth 10 billion dollars. Groupon has rejected Google's 6 billion-dollar takeover request, and some believe Groupon will hit $25 billion trillion once it goes public. Of course, the highest valuations are facebook,830 billion dollars
: "A", balance:1000, Pendingtransactions: []},{_id: "B", balance:1000, Pendingtransactions: []}]); Initialize transfer recordfor each money transfer operation, the transfer information is added to the Transactions collection, and the inserted record contains the following information: Source and destination fields, referencing _id fields from the Ccounts collectionValue field, declaring the transfer valueThe State field, which indicates the current transfer status, can be a value of initial,
processed will be checked and executed:
1) returned from a hardware interrupt code
2) In the ksoftirqd kernel thread
3) in the code that explicitly checks and executes the Soft Interrupt to be processed, such as the network subsystem
The Soft Interrupt should be executed in the do_softirq () function:
Asmlinkage void do_softirq (void)
{
_ U32 pending;
Unsigned long flags;
If (in_interrupt ())
Return;
Local_irq_save (flags );
, Block_softirq, Block_iopoll_softirq, tasklet_ SOFTIRQ, Sched_softirq, Hrtimer_softirq, RCU_SOFTIRQ,/ * Preferable RCU should always being the last SOFTIRQ */ Nr_softirqs};So when does the soft interrupt handler function run when the software interrupt registration is complete? Typically, a soft interrupt marks the interrupt handler before it returns, making it run at a later time. in the following places. The soft interrupts to be processed are checked and run:1. After
structure of the process contains the data member about the pending signals in the process: struct sigpending pending:
Struct sigpending {
Struct sigqueue * head, * tail;
Sigset_t signal;
};
The Third Member is all pending signal sets in the process. The first and second members point to the beginning and end of a sigqueue-type structure chain (called "
distribution processing time is clear, let's see how DO_SOFTIRQ is handled in KERNEL/SOFTIRQ.C:asmlinkage void Do_softirq (void) { __u32 pending; unsigned long flags; if (In_interrupt ()) return; Local_irq_save (flags); Pending = Local_softirq_pending (); if (pending) __do_softirq (); Local_irq_restore (flags);}local_softirq_pe
separated by the $ symbol, and a maximum of 10 keywords can be searched. For example, "Bank $ Hotel ".
Tag
No
None
Japanese barbecue/teppanyaki, Chaowai Street
Tag item, which can be searched in combination with q
Output
No
Xml
Json or xml
The output format is json or xml.
Scope
Yes
1
1, 2
The details of the search results. If the value is 1 or null, basic information is returned. if the value is 2, POI details are returned.
The origin of the group is the Groupon Web site from the US, while China's first group buying network is the United States and is based on the Groupon website. And in a short period of less than a year, China's group buying network has reached more than 1000, "buy" This word has been flooded the streets of the Internet, set off a name "group buying" consumption boom! From the E-commerce platform, even Taoba
, also known as the UI thread. By 5.0, a thread, called the render thread, has been added to complete the rendering of the Android application UI along with the UI thread. This can be referred to in the previous Android application UI hardware accelerated rendering technology brief introduction and study plan of this series of articles.To better support threading rendering, the CC (Chromium compositor) module in Chromium, which is responsible for rendering the Web page, creates three trees that
The selected version is the latest version: libev-4.04. The libev code is concise. In addition to encapsulation files such as the efficient I/O model, the core files are ev. h and ev. c, of which ev. c contains about 4000 lines. A large number of macros are used in the code, and macros are nested. To facilitate understanding of libev code, the macro is restored here.
The ev_watcher struct (its member is the public part of another structure ):
Typedef struct ev_watcher {
Int active; // activati
, also known as the UI thread. By 5.0, a thread, called the render thread, has been added to complete the rendering of the Android application UI along with the UI thread. This can be referred to in the previous Android application UI hardware accelerated rendering technology brief introduction and study plan of this series of articles.To better support threading rendering, the CC (Chromium compositor) module in Chromium, which is responsible for rendering the Web page, creates three trees that
representation of the signal in the kernelThe processing action of the signal is called the signal recursion (Delivery), the signal from the generation to the state between the recursion, called Signal pending (Pending). A process can choose to block (block) a signal. When the blocked signal is generated, it remains in the pending state until the process has unb
the outstanding signal sets in the process, the first and second members point to the end of a structure chain of sigqueue type (called the "pending signal information chain"), each sigqueue structure in the information chain depicts the information carried by a particular signal, and point to the next Sigqueue structure: struct sigqueue{struct sigqueue *next;siginfo_t info;} The signal in process registration refers to the signal value added to th
Provides various official and user-released code examples. For code reference, you are welcome to exchange the learning card volume test code.
Create a card volume:
Public function createcard () {// create a card volume$ Appid = C ('appid ');$ Appsecret = C ('scretid ');$ Asstonek = $ this-> get_token ($ appid, $ appsecret );$ Url = "https://api.weixin.qq.com/card/create? Access_token = ". $ asstonek;$ Pjson = '{"card ":{"Card_type": "GROUPON ","
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:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.