Method and device for realizing PHP (Hypertext Preprocessor) core reentrancy, server and memory medium

A server and kernel technology, applied in the computer field, can solve problems such as inability to reuse business code, low development efficiency, etc., and achieve the effect of improving concurrent processing capabilities

Active Publication Date: 2018-10-12
TENCENT TECH (SHENZHEN) CO LTD
View PDF5 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the traditional programming mode based on event asynchronous callback processing is very inefficient in the scenario of processing complex business logic; and the original business code cannot be reused

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for realizing PHP (Hypertext Preprocessor) core reentrancy, server and memory medium
  • Method and device for realizing PHP (Hypertext Preprocessor) core reentrancy, server and memory medium
  • Method and device for realizing PHP (Hypertext Preprocessor) core reentrancy, server and memory medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0025] In order to make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below in conjunction with the accompanying drawings.

[0026] The embodiment of the present invention provides a framework of a PHP kernel. The PHP core may be Zend Engine (PHP official engine). See figure 1 , The PHP core includes: Zend API (Application Programming Interface, Application Programming Interface), Executor (executor), Garbage Collector (garbage collector), Compiler (encoder), Language Parser (language analyzer), Language Lexer ( Language dictionary), Mem Manager (memory manager) and TSRM (Thread Safe Resource Manager, thread safe resource manager).

[0027] Among them, Mem Manager, used to implement the memory management of the entire PHP core; Language Lexer, used to implement lexical analysis of PHP scripts; Language Parser, used to implement syntax analysis of PHP scripts; Compil...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a method and device for realizing PHP (Hypertext Preprocessor) core reentrancy, a server and a memory medium and belongs to the technical field of a computer. The method comprises the steps of allocating a coroutine to a reentrant PHP core when the server receives a processing request; operating the PHP core through the coroutine, thereby obtaining an operation case of thePHP core; selecting a case identity of an idle case according to a global case table of the PHP core, wherein the global case table stores a corresponding relationship between at least one case identity and a case state; and switching the operation case of the PHP core to the selected idle case according to the case identity, and switching the access of a structural body pointer resource in the PHP core to a resource corresponding to the idle case according to the case identity. According to the method, the device, the server and the memory medium, the PHP core reentrancy is realized, so the PHP core has a coroutine characteristic, and the concurrent processing capability of the PHP core is improved.

Description

Technical field [0001] The present invention relates to the field of computer technology, in particular to a method, a device, a server and a storage medium for realizing the reentrant PHP kernel. Background technique [0002] In a multithreaded environment, PHP-FPM (FastCGI Process Manager, FastCGI Process Manager) is generally used to process processing requests. When PHP-FPM receives a processing request, it will assign a service process to the processing request. The service process uses the synchronous blocking IO (Input / Output, input / output) processing mode for processing, but the synchronous blocking IO processing mode is serious Limits the processing ability of PHP-FPM to handle high concurrent requests. The most effective way to improve concurrency is to make IO processing asynchronous. The traditional method of asynchronous IO processing is often implemented based on event asynchronous callback processing. However, the traditional programming model based on event asy...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/48
CPCG06F9/4881
Inventor 郑榕孙琦
Owner TENCENT TECH (SHENZHEN) CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products