Event library, expandable data management system and management method thereof
A technology for managing systems and expanding data, applied in the computer field, can solve the problems of increasing resource overhead of network waiting and context switching, blocking interface does not make good use of the characteristics of large memory and multi-core new hardware, etc., and achieves the goal of reducing time overhead Effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0042] Example 1: Use of the application layer server
[0043] The server first initializes the thread pool of onev_io_e through the onev_create_io of the event library, and adds the callback function of the monitoring observer and thread observer for each thread. Table 1 lists the observer types of the event library application libev, and the callback function of each event is completed through the operation box of the corresponding observer. Register interested events with libev, such as socket readable events, libev will manage the source of the registered time, and trigger the corresponding program when the event occurs.
[0044] At the beginning of a connection, all threads in the server thread pool open the listening port, and set the event loop body to listen to the socket accept event. When the event arrives, a thread in the thread pool triggers the accept operation on the listening file handle, creating Connect and initialize the read-write observer and timeout obser...
Embodiment 2
[0054] Embodiment 2: the use of application layer client
[0055] The application layer client can choose to send requests in two ways: synchronous and asynchronous.
[0056] Before sending the package, first create onev_session_e to allocate memory space for sending, pack the request into the session, set the server address of the session target server, and associate it with the message. Note here that each session contains a request, and each message can contain multiple sessions, such as Figure 4 .
[0057] Calling onev_client_dispatch afterwards means that the application layer needs the client to send requests asynchronously, and calling onev_client_send means that the application layer needs the client to send requests synchronously. The former will set the timeout time of the session through the onev_session_set_timeout macro before sending. After sending, the event library will select the I / O thread from the I / O thread pool, add the session to it and wake up the thr...
Embodiment 3
[0058] Example 3: Memory allocation in resource management
[0059] Use the memory pool scheme of fixed allocation of large memory and variable length application of small memory to manage memory, and then manage the allocation and release of resources such as network I / O, connections, and requests. Resources at all levels are maintained in the form of linked lists. Memory management is based on connections, that is, memory is released in units of connections, and resources between connections do not interfere with each other.
[0060] exist Figure 4 In , each database request corresponds to a specific request packet in the application layer, which runs through the entire process of request input, processing and output. When the client sends a request packet, it needs to encapsulate the request into a message, set the input buffer for decoding, the input buffer corresponding to the connection, set the processing function and the timeout observer. A message can contain only...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com