The invention discloses a
software component hot
upgrade method and
system based on execution context
dynamic switching, and relates to the technical field of thread switching. The
software component hot
upgrade method and
system based on execution context
dynamic switching comprises the following steps: S1, collecting context switching
monitoring data, and executing preprocessing on the context switching
monitoring data; s2, constructing a thread-
level data sequence, marking switchable threads, evaluating the current switching risk of each switchable thread, and outputting a switchable window sequence; s3, comprehensively evaluating the switching safety in the switchable window, and determining a safe switching opportunity point; and S4, executing thread switching, evaluating the stability of the switching process, judging whether to release the scheduling
queue freezing or not, and completing closed-
loop control of the hot
upgrade of the component. The problem that in the prior art, the safe switching opportunity of the thread in the I / O blocking and lock waiting state cannot be recognized, and consequently the new
code segment address is illegal and the segment error occurs after the thread is switched is solved.