angr.analyses.decompiler.pattern_match.priority

Keeping the pattern analyses from starving other threads, a GUI’s in particular.

angr.analyses.decompiler.pattern_match.priority.YIELD_INTERVAL = 0.02

seconds between two yields

angr.analyses.decompiler.pattern_match.priority.YIELD_SLEEP = 0.001

how long a yield sleeps; a microsecond is too short for the OS to wake the GUI thread before this one takes the GIL back

class angr.analyses.decompiler.pattern_match.priority.Checkpoint

Bases: object

Called from inside hot loops, as often as is convenient.

Every freq calls it looks at the clock, and at most once per interval seconds it sleeps for sleep seconds to let other threads take the GIL, as the CFG’s low-priority mode does, and then runs callback. The callback may raise to abort the analysis; a UI uses that to cancel.

__init__(low_priority=True, callback=None, freq=1, interval=0.02, sleep=0.001)
Parameters:
low_priority
callback
freq
interval
sleep