This application relates to the field of
computer technology, providing a non-intrusive Linux
memory barrier modification method and
system. The method is applied to scenarios where an
information system is migrated from a strong
memory model chip architecture to a weak
memory model chip architecture. Specifically, it includes: in the newly added
adaptation layer, determining the target
system calls invoked by the component layer, and constructing a rewritten function with the same name for each target
system call. The rewritten function sequentially includes a first
memory barrier instruction, an instruction to call the original target
system call, and a second
memory barrier instruction; compiling the rewritten function into a dynamic link
library; and when the
business process starts, preferentially loading the custom dynamic
library by preloading environment variables to hijack system calls, so that the
operating system's dynamic
linker redirects the component layer's calls to the target system calls to the rewritten function. This application achieves complete decoupling of
business logic and
adaptation logic by implanting a memory barrier at the
system call layer without modifying the business layer and component layer code.