Unlock instant, AI-driven research and patent intelligence for your innovation.

Unlocked memory application releasing method

A memory application, memory block technology, applied in the direction of memory address/allocation/relocation, memory system, instrument, etc.

Active Publication Date: 2013-11-20
WUHAN POST & TELECOMM RES INST CO LTD
View PDF3 Cites 19 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Not to mention that multiple threads compete to acquire the lock of the global shared memory pool, even if an independent cache pool is defined for each thread, the overhead of the lock is unavoidable

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
  • Unlocked memory application releasing method
  • Unlocked memory application releasing method
  • Unlocked memory application releasing method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0029] Based on a characteristic of the current embedded system: the threads of the embedded system often run periodically and will not end. In this way, irregular memory operations can be scheduled to a fixed time point, and there is no need to worry about the thread applying for memory ending before the memory is released. A compare and replace (CAS) atomic operation is often used in lock-free research. This operation reads a shared resource (P), assigns (P) a new value, and returns the old value if and only if (P) is equal to the old value. Since this operation is an atomic operation, the method of protecting shared resources can be achieved without locks. The present invention utilizes a Compare and Replace (CAS) operation. The technical solution of the present invention will be described in detail below in conjunction with the drawings and embodiments.

[0030] For ease of description, the present invention provides an embodiment with a memory pool management solution....

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 an unlocked memory application releasing method. According to the unlocked memory application releasing method, a block of memory pool is occupied by each thread independently to serve as a cache, and all memory blocks applied from the caches are finally released back into the caches; when a memory application is carried out, an application thread obtains a block of memory from a corresponding cache, the thread number of the application thread is marked on the distributed memory block, and then the application is accomplished; after the memory block is used, the thread is released and the thread number, marked on the memory block, of the application thread is checked, the memory block is returned to the corresponding cache if the application belongs to the corresponding cache, and then releasing is accomplished; if the application does not belongs to the cache, comparison and replacement are carried out in sequence, the memory block is mounted on a one-way chain table of the application thread, and then releasing is accomplished. In addition, each time when a message is sent or received by a task, periodical detection is carried out on the application thread, and all the memory blocks on the one-way chain table are returned to the caches.

Description

technical field [0001] The invention relates to the technical field of embedded systems, in particular to a memory application release method for a multi-thread system. Background technique [0002] Embedded systems often use multithreading to complete different tasks, and the threads are connected to each other and communicate with each other using messages. By using shared memory, inter-thread communication, the destination thread can directly read the message of the source thread without copying. However, this leads to the need to use a mutex when applying for and releasing the memory used by the message, which affects efficiency. At present, there are generally two methods for applying and releasing heap memory. One is to directly call the memory application interface (ptmalloc) and release interface (free) of the general function library (glibc), and the other is to establish its own memory pool for management. [0003] The logic of the general function library (glibc...

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
IPC IPC(8): G06F12/08G06F12/0891
Inventor 赵畅
Owner WUHAN POST & TELECOMM RES INST CO LTD