Tag: tech

How Image Generation Actually Works

Fom Pixels to Diffusion: How Image Generation Actually Works This post began as scattered notes and questions while trying to understand each of these topics in more detail. The deeper the questions went, the more the concepts started connecting, but the notes themselves remained fragmented. AI was used to piece those fragments together into a coherent sequence. The result is a connected mental model of the topics discussed. It is intentionally simplified, as the goal at this stage is to understand the core ideas without getting lost in the deeper mathematical and implementation details. Read more...

How Operating Systems and Hardware Enforce Atomicity

From File Systems to Transistors: How Operating Systems and Hardware Enforce Atomicity - Part 1 AI Generated Problem Statement: If two CPU cores attempt the same operation at almost exactly the same instant—such as creating temp.txt with O_CREAT | O_EXCL—why does only one succeed? Every backend engineer has relied on file-system atomicity. Creating a lock file with open(..., O_CREAT | O_EXCL) or using mkdir() as a lock are common synchronization techniques. Read more...

Long Polling

Explanations of Long Polling start with the server “holds the connection open.”. To understand Long Polling, it helps to go one level lower than HTTP. Suppose a client wants to fetch messages. GET /messages The HTTP request is converted into bytes, passed to TCP, encapsulated into IP packets and sent over the network. Before any HTTP request is sent, TCP establishes a connection. Client Server SYN ----------------------> <------------------- SYN-ACK ACK ----------------------> Once this handshake completes, the client and server have an established TCP connection. Read more...