Erlang process timeout management method

A management method and process technology, applied in the computer field, can solve problems such as not supporting process execution setting time limit, and achieve the effect of avoiding devastating impact, avoiding performance loss, and avoiding single-point performance bottlenecks

Active Publication Date: 2021-03-19
厦门极致互动网络技术股份有限公司
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Although the Erlang virtual machine supports the creation of a large number of lightweight processes at the same time, it does not support setting a time limit for the execution of the processes

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
  • Erlang process timeout management method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0026] Such as figure 1 Shown, a kind of Erlang process overtime management method comprises the steps:

[0027] After S1, the Erlang node is started, create N overtime supervisory processes equal to the number of cores of the CPU;

[0028] The timeout monitoring process here is consistent with the number of CPU cores, making full use of the performance of modern multi-core CPUs.

[0029] S2, when each overtime supervisory process starts, an ordered ets table is created;

[0030] The ets table can be accessed by other processes and is used to store process timeout information, and the primary key of the ets table is {end-time, pid}, wherein end-time represents the expiration time of the process execution, and pid represents the process identity; The ets table adopts the type of ordered grouping, that is, the ets table is sorted according to the primary key from small to large. Create an ets table of the ordered-set type, which is an ordered grouping type, sorted by the prim...

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 an Erlang process timeout management method. The method comprises the following steps: S1, creating N timeout supervision processes of which the number is equal to the number of cores of a CPU; S2, when each timeout supervision process is started, creating an ordered ts table; S3, using an agent function as an entrance of the Erlang process to be supervised, randomly selecting an ts table by the agent function, and putting process execution expiration time endtime and a process identity pid into the ts table to form a primary key {endtime, pid}; S4, executing a real entry point function and parameters by the agent function; S5, enabling each timeout supervision process to scan out a primary key with endtime smaller than the current time in the ts table at set intervals, executing an ending operation on a process identity pid corresponding to the primary key, and removing the primary key from the ts table; S6, enabling the proxy function to remove timeout data ofthe process with the primary key being {end-time, pid}. The invention provides a process timeout supervision method which is extremely low in performance loss, has no single-point bottleneck and makes full use of a multi-core CPU, and destructive influence of abnormal processes such as endless loop and the like on system performance is avoided.

Description

technical field [0001] The invention relates to the technical field of computers, in particular to an Erlang process timeout management method. Background technique [0002] Erlang provides an ultra-lightweight process mechanism for executing functions. According to hardware performance, the ultra-lightweight processes that can be executed in parallel can range from thousands to hundreds of thousands or millions. Although the Erlang virtual machine supports creating a large number of lightweight processes at the same time, it does not support setting a time limit for the execution of the processes. If there is an infinite loop, a large number of abnormalities, and long-term calculations during process execution, it will have a devastating impact on system performance. Therefore, a process timeout monitoring mechanism is required to manage Erlang timeout processes. Contents of the invention [0003] In order to solve the above-mentioned problems, the present invention prov...

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): G06F11/07
CPCG06F11/0715G06F11/0757
Inventor 汪兴
Owner 厦门极致互动网络技术股份有限公司
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