Mehdi Akiki

Writing archive

Everything published under Writing, newest first. Each entry is labelled as part of an investigation, an article or reference. Short engineering notes have their own archive.

  • Published on

    Investigation · Part 19 of 20 · From source to a running process

    How Each Thread Gets Its Own Copy of a Variable: Thread-Local Storage

    One _Thread_local variable, four threads, four copies at four addresses, and one instruction to reach each of them. I followed the fs register, the TLS segment, the access models of the ELF TLS document, their cost, and Rust's thread_local! in the disassembly.
  • Published on
    A recoverable agent stores workflow decisions and effect identities outside the process. Resume from durable state, reconcile ambiguous actions, and never confuse chat history with execution state.
  • Published on

    Investigation · Part 19 of 20 · What survives a crash

    Updating Several Files at Once With One Rename

    Two files saved safely one after the other are not saved safely together: a kill left a new config with old data 85 times in 300. A version directory and one symlink rename, or renameat2 with RENAME_EXCHANGE, switched both files at once in every test. LevelDB does the same with CURRENT.
  • Published on
    A Kafka rebalance can revoke a partition while application work is still running. Track ownership generations, contiguous completion, offset commits, and external effects explicitly.