Thread synchronization method and system and medium

A thread and sub-thread technology, applied in the fields of systems and media, and thread synchronization methods, can solve problems affecting bandwidth and server performance, and achieve the effects of avoiding frequent synchronization, rapid backup, and reducing resource consumption.

Active Publication Date: 2021-04-16
SUZHOU LANGCHAO INTELLIGENT TECH CO LTD
View PDF2 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The technical problem mainly solved by the present invention is that the existing file synchronization triggers rsync operations frequently and frequently affects bandwidth and server performance

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
  • Thread synchronization method and system and medium
  • Thread synchronization method and system and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0046] see figure 1 , a thread synchronization method comprising:

[0047] S100, setting the maximum event value Maxdelays and the threshold of rsync;

[0048] S200, set the file directory that needs to be monitored in the file system, create a monitoring process to monitor and read the event in the monitoring mode inotifyMode, the event in the monitoring mode inotifyMode includes file creation, deletion, modification, movement, and file attribute change, 5 mode; every time an event in the monitoring mode is monitored, this message is written into the event pool for accumulation, and it is judged whether the number of events in the event pool exceeds Maxdelays;

[0049] S300, if it exceeds Maxdelays, trigger a multi-threaded calling process, call the rsync process, and when the number of calling rsync exceeds the rsync threshold, perform a synchronization operation to synchronize the main directory content in the file system server to each web server in real time.

[0050] C...

Embodiment 2

[0063] see figure 2 , based on the same inventive concept as the thread synchronization method in the foregoing embodiments, the embodiment of this specification also provides a thread synchronization system, including: a threshold setting module, an event monitoring module, a judgment module and a thread scheduling module;

[0064] The threshold setting module sets the threshold of the maximum event value Maxdelays and rsync;

[0065] The monitoring event module monitors and reads the events in the monitoring mode inotifyMode; and stores the events monitored in the monitoring mode,

[0066] The judging module judges whether the accumulated number of events exceeds Maxdelays;

[0067] If it exceeds Maxdelays, trigger the thread scheduling module;

[0068] The thread scheduling module calls the rsync process, and when the number of called rsync processes exceeds the rsync threshold, a synchronization operation is performed to synchronize the content in the file system server...

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 thread synchronization method. The method comprises the steps of setting an event threshold value and an rsync threshold value are set; creating a monitoring process to monitor and read the events in the monitoring mode, writing the events in the monitoring mode into an event pool, and judging whether the number of the events in the event pool exceeds an event threshold value or not; if the content does not exceed the event threshold, not synchronizing the content in the file system server; if the number of the called rsync exceeds the event threshold value, triggering a multi-thread calling process, calling the rsync process, executing a synchronization operation when the number of the called rsync exceeds the rsync threshold value, and synchronizing the content in the file system server to the web server; through the above mode, the synchronization work from the server to the client can be completed by using the message notification mechanism of the Linux kernel, the frequent operation of rsync is avoided, excessive rsync threads are prevented from being started, and the resource consumption of the server is reduced.

Description

technical field [0001] The present invention relates to the field of computer application technology, in particular to a thread synchronization method, system and medium. Background technique [0002] Rsync is a remote data synchronization tool often used in operation and maintenance work. It can realize synchronous file transfer among multiple hosts, and has the advantages of high security and fast backup. In the current prior art, the inotify mechanism is added, and rsync is mobilized for file synchronization by monitoring changes in the file attributes of the file system by using the message notification mechanism inotify in the Linux kernel. Although this technology achieves the effect of real-time synchronization, there are still some problems. For example, rsync plus inotify is a triggered update, and each file change triggers rsync operation, resulting in frequent rsync operations, affecting bandwidth and server performance. Contents of the invention [0003] The t...

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/48G06F9/50G06F9/54G06F11/14G06F16/178G06F16/18
Inventor 兰庆元亓颖
Owner SUZHOU LANGCHAO INTELLIGENT TECH 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