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

Task allocation method and device based on shared stack and computer equipment

A task allocation and computer program technology, applied in the field of communication, can solve problems such as memory waste, difficulty, and changing stack space usage, and achieve the effects of reducing space waste, reducing waste, and reducing chip costs

Pending Publication Date: 2022-07-08
芯翼信息科技(上海)有限公司 +1
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In the existing thread operation mode, the unused part of the thread stack cannot be reused
when the operating system is running figure 1 When TaskC is not identified in , the stacks of TaskA and TaskB are as follows figure 1 In the state shown, the free part of the two thread stacks has not been used by the thread, but other threads cannot use this part of memory, resulting in memory waste
Secondly, it is difficult to set the size of the thread stack. If you want to save memory as much as possible, you need to ensure that after the thread runs, the maximum stack space used by the thread just reaches the allocated stack space, but even after sufficient testing, it is not guaranteed. The maximum stack space usage obtained is the value obtained by the test, and a certain margin needs to be left. Moreover, adding some operation codes or function calls at will may change the usage of the stack space, and allocate as much as possible for the stack space. Small values ​​make it very difficult to

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
  • Task allocation method and device based on shared stack and computer equipment
  • Task allocation method and device based on shared stack and computer equipment
  • Task allocation method and device based on shared stack and computer equipment

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0034] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.

[0035] In one embodiment, as figure 2 As shown, a schematic flowchart of a task allocation method for a shared stack is provided, including the following steps:

[0036] Step 101, establishing a shared stack, and generating a first task;

[0037] In this embodiment, the above-mentioned task allocation method for a shared stack can be applied to a central processing unit, and the central processing unit (CPU) is connected to a memory, and the memory can include random storage memory and other kinds of memory, and the present invention does not make too much of this. ...

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 task allocation method for a shared stack, which comprises the following steps: establishing the shared stack, and generating a first task; controlling the first task to run on the shared stack; obtaining preset first heap memory information; backing up stack data of the first task to a first heap memory corresponding to first heap memory information; recovering stack data of a second task to the shared stack, and controlling the second task to run on the shared stack; through the mode of setting the shared stack, the waste degree of the thread stack can be reduced, the unused part of the thread stack can be used as a normal heap memory, the on-chip memory of a chip is compressed, the chip cost is reduced, the memory overhead is reduced, and the space waste of the thread stack is reduced to the maximum extent.

Description

technical field [0001] The present invention relates to the field of communication technologies, and in particular, to a method, device, computer equipment and storage medium for task allocation based on a shared stack. Background technique [0002] Embedded operating systems currently on the market, such as FreeRTOS, RT-Thread, etc., allocate a stack space for each thread when creating a thread to save on-site and temporary variables when the thread is running. like figure 1 As shown, when different threads are running, the SP pointer will be modified to point to the position of the thread stack. [0003] In the existing thread operation mode, the unused part of the thread stack cannot be reused. when the operating system is running figure 1 When TaskC is not identified in , the stacks of TaskA and TaskB are in the figure 1 In the state shown, the free part of the two thread stacks has not been used by the thread, but other threads cannot use this part of the memory, re...

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): G06F9/50
CPCG06F9/5016
Inventor 林家俊
Owner 芯翼信息科技(上海)有限公司