Concurrent Data Writing with Per-Thread Page Extension

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In existing database systems, when multiple threads concurrently write data into a data table, they often face inefficiencies due to the need for serial acquisition of write locks on memory pages, leading to prolonged waiting times and delayed data table extensions, especially when the last idle memory page is insufficient.

Innovation Solution

A data write method where individual threads autonomously extend a predetermined number (N) of idle data pages when they cannot acquire an available memory page, allowing them to proceed with writing data, thereby reducing thread blocking duration and improving data write performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If one thread centrally extends data pages for all threads that obtain no available memory page while all other threads wait, then data table extension can be coordinated, but thread blocking duration increases and data write performance deteriorates

Engineering Contradiction:
Improvedata table extension coordinationVSAvoidthread blocking duration
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent divides the centralized extension process into independent per-thread extension segments. Each thread that needs to extend the data table does so independently rather than waiting for a central coordinator, thereby eliminating thread blocking while maintaining coordination through the write lock mechanism on the data table structure.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Each thread performs data table extension autonomously when it needs to write data and no available memory pages are found. The thread independently acquires the write lock, extends the data table, and releases the lock without requiring central coordination, thus reducing waiting time while ensuring safe extension through lock-based coordination.

Inventive Principle:
Principle #25Self-service

2Reliability

If multiple threads queue up to sequentially acquire a write lock on the available memory page, then data consistency is maintained, but data write performance deteriorates due to prolonged waiting

Engineering Contradiction:
Improvedata consistencyVSAvoiddata write performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the write lock acquisition process by allowing threads to extend the data table independently rather than queuing for a single memory page lock. Each thread acquires the write lock on the data table structure itself, not on a specific memory page, enabling parallel extension operations while maintaining consistency through the lock mechanism.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements preliminary extension of the data table before threads need to write data. When a thread discovers no available memory pages, it immediately extends the data table in advance, ensuring that subsequent threads can find available pages without waiting for sequential lock acquisition, thus improving write performance while maintaining consistency.

Inventive Principle:
Principle #10Preliminary action

3Device complexity

If the data table is extended by one thread at a time based on the quantity of threads that apply for extending, then extension resources are managed centrally, but the data table is not extended in time and thread blocking increases

Engineering Contradiction:
Improveextension resource managementVSAvoiddata table extension time
Core Design Contradiction:
Device complexityVSLoss of time

Solution Approach 1:

The patent segments the extension operation into independent per-thread tasks rather than a centralized sequential process. Each thread that needs extension does so independently by acquiring the write lock on the data table, extending it, and releasing the lock, eliminating the bottleneck of single-threaded extension while maintaining manageable complexity through lock-based coordination.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentEP4730148A1Data writing method and apparatus, computer device, and storage medium
Publication Date: 2026.04.22 HUAWEI TECH CO LTD
  • EP4730148A1 patent drawingFigure 1
  • EP4730148A1 patent drawingFigure 2
  • EP4730148A1 patent drawingFigure 3

AI summary

Embodiments of this application disclose a data write method and apparatus, a computer device, and a storage medium, and pertain to the field of database technologies. In embodiments of this application, when any thread in the computer device obtains no available memory page from a plurality of idle memory pages corresponding to a target data table, the thread may extend N idle data pages for the thread, extend an idle memory page based on the N idle data pages, and write data into the extended idle memory page. It can be learned that the any thread that fails to obtain the available memory page may automatically trigger a data table extension procedure to extend N data pages for the thread in time for use by the thread. In addition, because no data page needs to be extended for another thread, duration required by each thread to extend a data page is short. This can shorten thread blocking duration, thereby improving data write performance.