Single-thread-program parallel processing apparatus
By designing a single-threaded program parallel processing device, using storage, identification, control and operation modules, precompiling and marking the source code of a single-threaded program, and generating multiple code segments that are executed in parallel, solving the problem of long operation time of a single-threaded program , realizes efficient parallel processing.
Patent Information
- Application Number
- PCT/CN2024/106719
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-16
- Filing Date
- 2024-07-22
- Publication Date
- 2025-02-20
AI Technical Summary
During the operation execution of a single-threaded program, the program paths are arranged in a continuous order, which causes the previous tasks to be processed before the subsequent tasks are executed, resulting in a long operation time.
A single-threaded program parallel processing device is designed, including a storage module, an identification module, a control module and an operation module. By precompiling the source code of a single-threaded program and marking the executable code, multiple code segments that can be executed in parallel are generated. The operation module executes these code segments in parallel processing, and the control module determines the completion status of the code segment and controls the execution of subsequent code segments by identifying.
It realizes parallel processing of single-threaded programs, improves the operation speed and reduces the operation time of the program.
Smart Images

Figure CN2024106719_20022025_PF_FP_ABST
Abstract
Description
Single-threaded program parallel processing device Technical Field
[0001] The present application relates to the field of processors, and in particular to a single-threaded program parallel processing device. Background Art
[0002] Single-threaded programs have the characteristics of system stability and strong scalability.
[0003] However, during the execution of a single-threaded program, the program paths taken are arranged in a continuous order, and the previous ones must be processed before the latter ones can be executed.
[0004] This results in a longer operation time for single-threaded programs. Summary of the Invention
[0005] In order to reduce program operation time, the present application provides a single-threaded program parallel processing device.
[0006] This application provides a single-threaded program parallel processing device, which adopts the following technical solutions:
[0007] A single-threaded program parallel processing device includes a storage module, an identification module, a control module and an operation module;
[0008] The storage module is used to store code segments;
[0009] The identification module is used to identify multiple code segments based on the markers marking the code segments, and the multiple code segments are used to be executed in parallel;
[0010] There are N computing modules.
[0011] The control module is used to control all the operation modules to execute multiple code segments in a parallel processing manner.
[0012] By adopting the above technical solution, the source code of the single-threaded program is compiled into executable code in advance, and the executable code is marked to obtain multiple code segments that can be executed in parallel. The multiple code segments are stored in the storage module, and the operation module executes the multiple code segments in a parallel processing manner, thereby realizing parallel processing of the single-threaded program, which is beneficial to improving the operation speed of the single-threaded program and reducing the program operation time.
[0013] Preferably, the control module is used to control all the operation modules to execute multiple code segments in a parallel processing manner, including:
[0014] The operation module is used to output an identifier when the execution of the code segment is completed;
[0015] The control module is used to control all the operation modules to execute the next group of N code segments in a parallel processing manner when N identifiers are detected.
[0016] By adopting the above technical solution, the flag is used to determine whether the current code segment has completed the operation, and then the operation of the subsequent code segment is controlled; after completing the parallel processing of N code segments, the parallel processing of the next group of N code segments is executed.
[0017] Preferably, the control module is used to control all the operation modules to execute multiple code segments in a parallel processing manner, including:
[0018] The control module is used to determine the status of all operation modules;
[0019] The control module is used to control the idle computing module to execute a specific code segment, where the specific code segment is any executable code segment among all code segments to be executed.
[0020] By adopting the above technical solution, the time required for each operation module to execute different code segments may vary. If any operation module is idle, the idle operation module will immediately execute the subsequent code segment, thereby reducing the program operation time.
[0021] Preferably, the control module is used to determine whether the code segment is executable based on the code segment execution condition.
[0022] By adopting the above technical solution, it is possible to control the idle state computing module to execute a specific code segment.
[0023] In summary, this application includes at least one of the following beneficial technical effects:
[0024] 1. Precompile the source code of a single-threaded program into executable code and mark the executable code to obtain multiple code segments that can be executed in parallel. The multiple code segments are stored in a storage module, and the computing module executes the multiple code segments in parallel, thus achieving parallel processing of the single-threaded program, which is beneficial to improving the computing speed of the single-threaded program and reducing the program computing time.
[0025] 2. Use the flag to determine whether the current code segment has completed the operation, and then control the operation of the subsequent code segment;
[0026] 3. During the parallel execution of multiple code segments, after completing the parallel processing of N code segments, the next group of N code segments will be executed in parallel;
[0027] 4. The time required for each operation module to execute different code segments may vary. If any operation module is idle, the idle operation module will immediately execute the subsequent code segments to reduce the program operation time. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] FIG1 is a structural block diagram of a device for parallel processing of single-threaded programs.
[0029] Explanation of the accompanying drawings: 1. Storage module; 2. Identification module; 3. Control module; 4. Operation module. DETAILED DESCRIPTION
[0030] The present application is further described in detail below with reference to FIG1 . Example 1
[0031] The present invention discloses a method for parallel processing of a single-threaded program, comprising the following steps:
[0032] A single-thread program parallel processing device includes a storage module 1, an identification module 2, a control module 3 and a calculation module 4.
[0033] The storage module 1 is used to store the code segments obtained by the above method.
[0034] The recognition module 2 is configured to recognize multiple code segments based on markers marking the code segments.
[0035] There are N computing modules 4 .
[0036] The control module 3 is used to control all the operation modules 4 to execute multiple code segments in a parallel processing manner.
[0037] Specifically,
[0038] The control module 3 is used to control all the operation modules 4 to execute N code segments in a parallel processing manner;
[0039] The operation module 4 is used to output an identification when the execution of the code segment is completed;
[0040] The control module 3 is configured to control all the operation modules 4 to execute the next group of N code segments in a parallel processing manner when N identifiers are detected. Example 2
[0041] The difference between this embodiment and embodiment 1 is that the control module 3 is used to control all the operation modules 4 to execute multiple code segments in a parallel processing manner, including:
[0042] The control module 3 is used to control all the operation modules 4 to execute N code segments in a parallel processing manner;
[0043] The control module 3 is used to determine the status of all the operation modules 4;
[0044] The control module 3 is used to control the idle computing module 4 to execute a specific code segment, where the specific code segment is any executable code segment among all code segments to be executed.
[0045] Specifically, the operation module 4 is used to output an identification when the execution of the code segment is completed;
[0046] The control module 3 determines the status of the operation module 4 based on the identification;
[0047] The control module 3 is used to determine whether the code segment is executable based on the code segment execution condition; the code segment execution condition includes the dependency relationship, causal relationship, data relationship, etc. with the executing code segment. Example 3
[0048] The difference between this embodiment and embodiment 1 is that the control module 3 is used to control all the operation modules 4 to execute multiple code segments in a parallel processing manner, including:
[0049] The control module 3 is used to control all the operation modules 4 to execute N code segments in a parallel processing manner;
[0050] The operation module 4 is used to output an identification when the execution of the code segment is completed;
[0051] The control module 3 is used to determine the status of all the operation modules 4;
[0052] The control module 3 is used to control the idle computing module 4 to execute a specific code segment when M identifiers are detected; wherein 1≤M<N, the specific code segment is any executable code segment among all code segments to be executed;
[0053] The control module 3 is configured to control all the operation modules 4 to execute the next group of N specific code segments in a parallel processing manner when N identifiers are detected.
[0054] The control module 3 is used to determine whether the code segment is executable based on the code segment execution condition; the code segment execution condition includes the dependency relationship, causal relationship, data relationship, etc. with the executing code segment.
[0055] The implementation principle of a single-threaded program parallel processing device in an embodiment of the present application is as follows: the source code of the single-threaded program is pre-compiled into executable code, and the executable code is marked to obtain multiple code segments that can be executed in parallel. The multiple code segments are stored in a storage module 1, and the operation module 4 executes the multiple code segments in a parallel processing manner, thereby realizing parallel processing of the single-threaded program, which is beneficial to improving the operation speed of the single-threaded program and reducing the program operation time.
[0056] The above are all preferred embodiments of the present application, and are not intended to limit the scope of protection of the present application. Therefore, any equivalent changes made based on the structure, shape, and principle of the present application should be included in the scope of protection of the present application.
Claims
1. A single-threaded program parallel processing device, characterized in that: It comprises a storage module (1), an identification module (2), a control module (3) and a calculation module (4); The storage module (1) is used to store code segments; The identification module (2) is used to identify multiple code segments based on the markers of the marked code segments, and the multiple code segments are used to be executed in parallel; The number of operation modules (4) is N. The control module (3) is used to control all the operation modules (4) to execute multiple code segments in a parallel processing manner.
2. The single-thread program parallel processing device according to claim 1, characterized in that: The control module (3) is used to control all the operation modules (4) to execute multiple code segments in a parallel processing manner, including: The operation module (4) is used to output an identification when the execution of the code segment is completed; The control module (3) is used to control all the operation modules (4) to execute the next group of N code segments in a parallel processing manner when N identifiers are detected.
3. The single-thread program parallel processing device according to claim 1, characterized in that: The control module (3) is used to control all the operation modules (4) to execute multiple code segments in a parallel processing manner, including: The control module (3) is used to determine the status of all the operation modules (4); The control module (3) is used to control the idle state computing module (4) to execute a specific code segment, where the specific code segment is any executable code segment among all the code segments to be executed.
4. The single-thread program parallel processing device according to claim 3, characterized in that: The control module (3) is used to determine whether the code segment is executable based on the code segment execution condition.
Citation Information
Patent Citations
Systems, methods, and apparatuses to decompose a sequential program into multiple threads, execute said threads, and reconstruct the sequential execution
CN102171650A
Method for creation and parallel operation of lightweight bare chip codes
CN105700913A
Code compiler, code compiling method, code compiling system and computer medium
CN113791770A
Method for Parallelizing Execution of Single Thread Programs
US20090165016A1
Method and system for converting a single-threaded software program into an application-specific supercomputer
US20130125097A1