An erlang process timeout management method

A management method and process technology, applied in the computer field, can solve the problem of not supporting process execution setting time limit, etc., to achieve the effect of avoiding destructive impact, avoiding performance loss, and avoiding single-point performance bottlenecks

Active Publication Date: 2022-04-29
厦门极致互动网络技术股份有限公司
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
  • An 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 overtime management method, comprising the following steps: S1, creating N overtime supervisory processes equal to the number of CPU cores; S2, creating an ordered ets table when each overtime supervisory process starts; S3. Use the proxy function as the entrance of the Erlang process to be supervised. The proxy function randomly selects an ets table, and puts the process execution expiration time end-time and process identity pid in the ets table to form a primary key {end-time, pid }; S4, the agent function executes the real entry point function and parameters; S5, each timeout supervisory process scans out the primary key whose end-time is less than the current time in the ets table at a set interval, and executes the process identity pid corresponding to the primary key operation, and remove the primary key from the ets table; S6, the proxy function removes the timeout data of the process whose primary key is {end-time, pid}. The invention provides a process overtime monitoring method with little performance loss, no single-point bottleneck, and full use of multi-core CPUs, which avoids the devastating impact of abnormal processes such as infinite loops on system performance.

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 Patents(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