Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A method and device for implementing concurrent containers

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, unsuitable concurrent containers, data consistency differences, etc., to reduce server costs, overcome CPU consumption and performance reduction, reduce desired effect

Active Publication Date: 2022-03-04
BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF4 Cites 0 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
  • A method and device for implementing concurrent containers
  • A method and device for implementing concurrent containers
  • A method and device for implementing concurrent containers

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 present invention provides a method and device for implementing concurrent containers, which help to physically isolate data in memory by adding sub-containers, thereby reducing CPU consumption caused by polling container locks. 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: add data to a sub-container in the parent container, and record the added data in the parent container The sequence number in the container, when the amount of added data reaches the first threshold, create a new sub-container in memory; and continue to add data to the created new sub-container, and record the added data in the parent The serial number in the container, when the amount of added data reaches the first threshold, create another new sub-container in memory; and so on, until all data is added to the parent container, where the sub-containers are in memory with each other physical isolation.

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 Patents(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 Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products