Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M6299

Reentrancy

Reentrancy
SystemsHigh supportSystems Theory
Included
account_tree

Updated 2026-07-30

Loading revision record…

Summary

Reentrant or re-entrant can refer to:

Definition

A function that is interrupted during execution (e.g., called by a signal handler) and then called again. If it can execute correctly without corrupting the previous state, it is 'reentrant'. The premise is: not relying on global variables, only using local data.

How to use

The ability to be interrupted at any time. Modern life is full of interruptions. To build yourself as a 'reentrant' system: work without relying on 'a specific mood' or 'continuous blocks of time' (global variables). Be interrupted at any time, resume at any time, and do it without errors.

Mechanism

Reentrancy refers to a program module that can be interrupted during execution and safely re-entered (called again), requiring that it does not depend on static shared state. In the context of smart contracts, reentrancy is a typical vulnerability.

Practice

In progress 0/1

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%

Cases

  • Ethereum's The DAO lost a huge amount of money due to a reentrancy vulnerability that allowed repeated withdrawals.

Common pitfalls

  • Mistakenly thinking that single-threaded means no reentrancy. Callbacks, interrupts, and async can all trigger it.
Sources

Source support: Explicit

References currently contain only Wikipedia links; primary sources still need review.

  • link
    en.wikipedia.orghttps://en.wikipedia.org/wiki/ReentrantZH · Explicit
    verified
account_treeGenealogyexpand_more

RELATED MODELS