Method and device for realizing concurrent container

A container and sub-container technology, applied in the computer field, can solve problems such as inability to distinguish whether the V value has changed, inapplicability of concurrent containers, and differences in data consistency, so as to reduce server costs, overcome CPU consumption and performance degradation, and reduce required effect

Active Publication Date: 2018-11-02
BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF4 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In the process of realizing the present invention, the inventor has found that there are at least the following problems in the prior art: in the current programming process, in order to avoid the difference in data consistency caused by concurrent operation of a certain set (for example: one piece of data in the set is simultaneously used by multiple thread modification, it is impossible to determine which thread modified the piece of data last), usually a collection that supports concurrent operations (for example: CopyOnWriteArrayList, etc.)
In addition, ABA problems may arise for concurrent containers, that is, when a thread performs a CAS (Compare and Swap) operation on a certain parameter V, assuming that V was originally A, if another thread modifies V to B, Then modify it back to A, the CAS operation of the current thread cannot tell whether the current V value has changed
Therefore, concurrent containers in the prior art are not applicable in some scenarios

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 and device for realizing concurrent container
  • Method and device for realizing concurrent container
  • Method and device for realizing concurrent container

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0040] Exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present invention to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

[0041] figure 2 is a schematic diagram of creating a parent container according to an embodiment of the present invention. Such as figure 2 As shown, creating the parent container is adding data to the parent container. In this embodiment, the parent container is composed of multiple sub-containers, and the parent container includes a counter whose counter value indic...

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 provides a method and device for realizing a concurrent container. The data can be physically isolated on the internal memory through a way of adding a sub-container, thereby reducing CPU consumption caused by polling a container lock. The method is characterized in that the concurrent container is a parent container composed of multiple sub-containers, and the parent container is created according to the following steps: adding data in one sub-container in the parent container, and recording a serial number of the added data in the parent container, and creating a new sub-container in the internal memory when the amount of the added data achieves the first threshold; and continuously adding data in the newly created sub-container, and recording the serial number of the addeddata in the parent container, and creating another new sub-container in the internal memory when the amount of the added data achieves the first threshold; repeating the above operation until all data is added in the parent container, wherein the sub-containers are physically isolated from each other in the internal memory.

Description

technical field [0001] The present invention relates to the field of computer technology, in particular to a method and device for realizing concurrent containers. Background technique [0002] When writing a program, it is often necessary to manage a large number of object references. In order to achieve effective classification management, references of the same type are placed in the same data container. For example, a JAVA container is an instance of a series of classes provided by a JAVA API (Application Programming Interface, application programming interface), used to store objects in a program, and can be understood as a collection of stored data. Since object references that may be used at any time are stored in the data container, general data containers provide basic interface functions such as query, traversal, and modification. [0003] JAVA containers are divided into synchronous containers and concurrent containers. Synchronous containers include Vector, Ha...

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): G06F8/30G06F9/52
CPCG06F8/315G06F9/52
Inventor 张志维
Owner BEIJING JINGDONG SHANGKE INFORMATION 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