Data processing method and device

A data processing device and data processing technology, applied in the field of data processing, can solve problems affecting reader priority, thread switching overhead, and affecting concurrency, etc., to achieve the effects of solving concurrency problems, improving performance, and improving concurrency

Active Publication Date: 2020-03-10
ALIBABA GRP HLDG LTD
View PDF11 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, due to the mutual exclusion of read-write locks, thread switching overhead is caused, which affects the degree of concurrency. In systems with relatively high performance requirements, it is easy to become a bottleneck.
Read-write locks also have the problem of reader priority and writer priority, which will also affect the priority order of readers and writers

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
  • Data processing method and device
  • Data processing method and device
  • Data processing method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0073] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the application. However, the present application can be implemented in many other ways different from those described here, and those skilled in the art can make similar promotions without violating the connotation of the present application. Therefore, the present application is not limited by the specific implementation disclosed below.

[0074] The first embodiment of the present application provides a method for writing cache data blocks. Please see figure 1 , which is a flowchart of the first embodiment of the present application. Combine the following figure 1 A data writing method provided in the first embodiment of the present application will be described in detail.

[0075] The implementation of the method is divided into a write preparation phase and a write execution phase, both of which are atomic operation phases.

[0076] Both the wri...

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 data processing method and device. The data processing method comprises the steps of obtaining information of a first buffer area; acquiring a first cache data block corresponding to the first buffer area according to the information of the first buffer area and a mapping relationship between the buffer area and the cache data block; setting a writing state of the first cache data block to forbid a reading operation for the first cache data block; obtaining a version number of the first cache data block; judging whether the obtained version number of the first cache data block is the same as the current version number of the first cache data block or not; If yes, writing data to be written into the first cache data block, and clearing a writing state of the firstcache data block to allow a reading operation for the first cache data block. By adopting the data processing method provided by the invention, the problem of concurrence of cache data reading and writing of a single producer and multiple consumers is solved.

Description

technical field [0001] The present application relates to the field of data processing, in particular to a method and device for writing and reading cached data. Background technique [0002] In a distributed system, multi-threads cooperate to complete tasks. A typical scenario is that one thread (producer thread) produces data, and multiple threads (consumer threads) consume data. A cache is usually used to store these data, and the interaction between multiple threads is performed on this cache. [0003] In the above scenario, one producer thread writes some data into a buffer in memory, multiple consumer threads read some data from the buffer, and repeat the process individually. In the process of reading and writing the buffer, it is necessary to ensure that the consumer will not fetch inconsistent data from the buffer. [0004] A classic solution is to use a mutex. There is a read-write lock (RwLock) in the Cache for synchronization. When the producer writes data, i...

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/52G06F9/54
CPCG06F9/544G06F9/526Y02D10/00
Inventor 邢勇张小路
Owner ALIBABA GRP HLDG 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