Link-Time Resource Allocation for Multi-Threaded Processors
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing compilers and linkers struggle to identify conflicts and resource allocation issues in multi-threaded programs, particularly when parallelism is explicit in the source code, as they lack visibility of overall thread interactions and resource requirements, leading to potential race conditions and resource overloads during execution.
Innovation Solution
A method and tool-chain that compiles and links source code modules to generate object modules with symbols indicating resource usage, allowing the linker to assess these symbols at link-time to detect conflicts and optimize resource allocation, thereby ensuring safe execution of parallel threads.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If the compiler compiles each source code module independently, then the compilation process is simpler and faster, but the compiler cannot detect overall resource conflicts and allocation issues in multi-threaded programs
Solution Approach 1:
The compilation process is segmented into two distinct phases: a compilation phase where each source module is independently compiled into an object module with embedded resource usage symbols, and a linking phase where the linker collects and analyzes these symbols to detect resource conflicts. This segmentation allows independent compilation for speed while enabling comprehensive resource analysis for reliability.
Solution Approach 2:
The compiler performs preliminary action by embedding resource usage symbols into each object module during independent compilation. This preliminary tagging of resource requirements enables the linker to later perform comprehensive resource conflict detection without requiring the compiler to have full visibility of all modules.
2Reliability
If the linker performs comprehensive resource assessment at link-time, then resource conflicts are detected and allocation is optimized, but the linking process becomes more complex and time-consuming
Solution Approach 1:
Each object module provides self-service by containing embedded symbols that automatically declare its resource usage requirements. The linker simply collects and processes these self-provided declarations without requiring complex analysis of source code, reducing linking complexity while maintaining comprehensive resource detection capability.
3Measurement precision
If resource profiling is performed at compile-time for each module, then resource requirements are identified early, but the compiler cannot determine overall resource requirements when threads come from different source modules
Solution Approach 1:
Resource usage symbols act as intermediaries between the compiler and linker. The compiler precisely identifies resource requirements for each module and encodes them in symbols, which then serve as carriers of this information to the linker. The linker collects these symbol-based representations to reconstruct the overall resource picture, preventing information loss across module boundaries.
Data Source
AI summary
A method comprising: independently compiling a plurality of modules of source code to generate a plurality of respective object modules comprising a plurality of respective parallel threads explicitly designated by a user to be executed in parallel on a target platform; in each of the object modules, inserting at least one symbol indicative of a usage of a resource of the target platform associated with the respective thread; executing a linker to perform a linking process for linking the object modules, wherein the linking process comprises assessing the symbols in conjunction with one another, and based on the assessment generating an indication relating to a usage of the resource required for execution of the threads in parallel.


