Method for restricting parallel execution of shell script

A script and execution time technology, applied in the field of limiting parallel execution of shell scripts on linux and unix platforms, can solve problems such as difficult to control parallel execution of shell scripts

Inactive Publication Date: 2007-12-05
ZTE CORP
View PDF0 Cites 14 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] The technical problem to be solved by the present invention is to provide a method for limiting the parallel execution of sh

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 for restricting parallel execution of shell script
  • Method for restricting parallel execution of shell script
  • Method for restricting parallel execution of shell script

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0021] The main idea of ​​the present invention is exactly, adopts the token similar to Ethernet to solve the defect on the original technology.

[0022] The present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0023] As shown in Figure 1, the embodiment of the present invention limits the method that shell script executes in parallel, comprises the following steps:

[0024] Step 101, when a shell script needs to be executed, the script module processor writes a request to the pipeline, and the request content includes the process number of the shell script to be executed;

[0025] Step 102, the token module processor sequentially reads the requests at the other end of the pipeline, and when a token is free, sends the token to the first requesting shell script process in the order of the request until no token is available; The process with the token is allowed to run; the process without the token will ...

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 limit shell script parallel executing method in the linux and unix platform, which comprises the following steps: using script mode processor to write request into pipe when the shell script needs to be executed; reading the request through token mode processor at the other end of pipe sequently; transmitting the token to the shell script according to the sequence of request when the token is free until the token is finished; obtaining the process permitting operation of token; exiting the execution if not obtaining the process of token. The invention guides token concept to realize 'serialization' of multi-process in the critical area through linux pipe, which uses single locking detecting script to detect the locking to solve the locking problem effectively without using multi-parallel process to operate one token.

Description

technical field [0001] The invention relates to script operation control of linux, in particular to a method for restricting parallel execution of shell scripts on linux and unix platforms. Background technique [0002] At present, with the widespread use of linux, shell scripts have also been widely used, but in the process of actual application, this requirement is often required. The same script only allows one shell script to run at the same time, that is to say, at the same time No more than two identical scripts are allowed to be running. [0003] Currently, there are two widely used technologies of "restricting the simultaneous permission of shell scripts", but both of them have certain deficiencies: [0004] The first is to find out the number of running scripts with commands such as ps. If it is greater than or equal to 2, exit the current script, and if it is equal to 1, it will run. The disadvantages of this technique are: First, there are many pitfalls in obtai...

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
IPC IPC(8): G06F9/48
Inventor 谢斌
Owner ZTE CORP
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