6tanmay
0 followers · 2 following · 785 views
on the atlas — 13
- What I Mean When I Say I'm Indifferent - Brad Feld1 savers
- 27 Pieces of Advice on my 27th Birthday - Jackson Dahl13 savers
- QUIC is not quick enough over fast internet | Hacker News1 savers
- Your company needs Junior devs1 savers
- QUIC is not Quick Enough over Fast Internet | Proceedings of the ACM Web Conference 20241 savers
- Slice Dat Time | Putting the "You" in CPU1 savers
- The "Basics" | Putting the "You" in CPU7 savers
- The Imperfectionist: How to forget what you read1 savers
- Schlep Blindness9 savers
- Childhoods of exceptional people - by Henrik Karlsson69 savers
- More people should write « the jsomers.net blog28 savers
- Struct padding in C++ - Stack Overflow1 savers
- C++ Memory alignment - should we care? - Stack Overflow1 savers
highlights — 54
After my run, I explained this more clearly, reiterating that I had a modest preference for A but was good with either A or B. Instead of “indifference,” I stated that I was “tranquil.” After even more reflection, I think a better concept would have been “equanimity.”
What I Mean When I Say I'm Indifferent - Brad FeldThe Stoics were not indifferent in that sense at all, it’s that they were good either way. It’s not that they didn’t care, it’s that they were good either way. Does that make sense? The point was to be strong enough that there wasn’t a need to need things to go in a particular direction. Seneca for his part would say that obviously it’s better to be rich than poor, tall than short, but the Stoic was indifferent when fate actually dealt out its hand on the matter. Because the Stoic was strong enough to make good of it—whatever it was.
What I Mean When I Say I'm Indifferent - Brad FeldHave no interest in doing business as usual.
27 Pieces of Advice on my 27th Birthday - Jackson DahlA stable team of long-term colleagues falls into groupthink and loses some ability to innovate. They sometimes form an immune system to outside ideas and experience. Onboarding anyone, especially juniors may seem like an annoying chore, as the colleagues don’t enjoy teaching and learning.
Your company needs Junior devsAs argued in the book Range - generalists often bring innovative ideas to the table. The Wright Brothers are a classic example of non-expert, tinkering bicycle mechanics that end up inventing a flying machine. NoSQL databases come from distributed systems tinkerers, not relational database experts.
Your company needs Junior devsTeaching helps not just the juniors, but the seniors too. The “Protege effect” is a well studied phenomenon where the teacher’s knowledge deepens when required to teach. Juniors force-multiply seniors, not by writing code, but just by forcing seniors to teach and rethink their knowledge.
Your company needs Junior devsHTTP2 was a prototype that was designed by people who either assumed that mobile internet would get better much quicker than it did, or who didn't understand what packet loss did to throughput.
QUIC is not quick enough over fast internet | Hacker NewsIn the early days of QUIC, many people pointed out that the UDP stack has had far far less optimization put into it than the TCP stack. Sure enough, some of the issues identified here arise because the UDP stack isn't doing things that it could do but that nobody has been motivated to make it do, such as UDP generic receive offload. Papers like this are very likely to lead to optimizations both obvious and subtle.
QUIC is not quick enough over fast internet | Hacker NewsLately, BigTech only wants elite squads of Staff devs that can “hit the ground running” on the big (often AI) initiative. It’s been remarked (over and over) that AI will completely replace junior developers. Juniors, after all, exist to do “code monkey” work, easily replaced with an LLM. However, that misses the mark on why we have junior employees. Coaching junior employees becomes its own force multiplier for innovating at scale. It’s not about the added labor, it’s about a psychologically safe culture that values teaching and learning, and the innovation that this unlocks.
Your company needs Junior devsThrough rigorous packet trace analysis and kernel- and user-space profiling, we identify the root cause to be high receiver-side processing overhead, in particular, excessive data packets and QUIC's user-space ACKs.
QUIC is not Quick Enough over Fast Internet | Proceedings of the ACM Web Conference 2024. Through rigorous packet trace analysis and kernel- and user-space profiling, we identify the root cause to be high receiver-side processing overhead, in particular, excessive data packets and QUIC's user-space ACKs.
QUIC is not Quick Enough over Fast Internet | Proceedings of the ACM Web Conference 2024We find that over fast Internet, the UDP+QUIC+HTTP/3 stack suffers a data rate reduction of up to 45.2% compared to the TCP+TLS+HTTP/2 counterpart. Moreover, the performance gap between QUIC and HTTP/2 grows as the underlying bandwidth increases.
QUIC is not Quick Enough over Fast Internet | Proceedings of the ACM Web Conference 2024So far, we’ve been only talking about the preemption and scheduling of userland processes. Kernel code might make programs feel laggy if it took too long handling a syscall or executing driver code. Modern kernels, including Linux, are preemptive kernels. This means they’re programmed in a way that allows kernel code itself to be interrupted and scheduled just like userland processes.
Slice Dat Time | Putting the "You" in CPUEvery time the OS preempts a process it needs to load the new program’s saved execution context, including its memory environment. This is accomplished by telling the CPU to use a different page table, the mapping from “virtual” to physical addresses. This is also the system that prevents programs from accessing each other’s memory;
Slice Dat Time | Putting the "You" in CPUProcess switching is computationally expensive because it requires saving the entire state of the current program and restoring a different one. Past a certain point, too small a timeslice can result in performance problems with processes switching too rapidly. It’s common to give the timeslice duration a lower bound (minimum granularity). This does mean that the target latency is exceeded when there are enough processes for the minimum granularity to take effect.
Slice Dat Time | Putting the "You" in CPUTimeslices are calculated by dividing the target latency by the total number of tasks; this is better than fixed timeslice scheduling because it eliminates wasteful task switching with fewer processes. With a target latency of 15 ms and 10 processes, each process would get 15/10 or 1.5 ms to run. With only 3 processes, each process gets a longer 5 ms timeslice while still hitting the target latency.
Slice Dat Time | Putting the "You" in CPUA slight improvement to fixed timeslice scheduling is to pick a target latency — the ideal longest time for a process to respond. The target latency is the time it takes for a process to resume execution after being preempted, assuming a reasonable number of processes.
Slice Dat Time | Putting the "You" in CPUA timeslice is the duration an OS scheduler allows a process to run before preempting it. The simplest way to pick timeslices is to give every process the same timeslice, perhaps in the 10 ms range, and cycle through tasks in order. This is called fixed timeslice round-robin scheduling.
Slice Dat Time | Putting the "You" in CPUOS schedulers use timer chips like PITs to trigger hardware interrupts for multitasking: Before jumping to program code, the OS sets the timer chip to trigger an interrupt after some period of time. The OS switches to user mode and jumps to the next instruction of the program. When the timer elapses, it triggers a hardware interrupt to switch to kernel mode and jump to OS code. The OS can now save where the program left off, load a different program, and repeat the process. This is called preemptive multitasking; the interruption of a process is called preemption.
Slice Dat Time | Putting the "You" in CPUoperating systems provide an abstraction layer on top of these interrupts. Reusable higher-level library functions that wrap the necessary assembly instructions are provided by libc on Unix-like systems and part of a library called ntdll.dll on Windows.
The "Basics" | Putting the "You" in CPUWhen you call exit(1) from C running on a Unix-like system, that function is internally running machine code to trigger an interrupt, after placing the system call’s opcode and arguments in the right registers/stack/whatever. Computers are so cool!
The "Basics" | Putting the "You" in CPUPrograms need to pass data to the operating system when triggering a syscall; the OS needs to know which specific system call to execute alongside any data the syscall itself needs, for example, what filename to open. The mechanism for passing this data varies by operating system and architecture, but it’s usually done by placing data in certain registers or on the stack before triggering the interrupt.
The "Basics" | Putting the "You" in CPUWhen this kernel code finishes, it uses an instruction like IRET to tell the CPU to switch back to user mode and return the instruction pointer to where it was when the interrupt was triggered.
The "Basics" | Putting the "You" in CPUThen, userland programs can use an instruction like INT which tells the processor to look up the given interrupt number in the IVT, switch to kernel mode, and then jump the instruction pointer to the memory address stored in the IVT.
The "Basics" | Putting the "You" in CPUThen, userland programs can use an instruction like INT which tells the processor to look up the given interrupt number in the IVT, switch to kernel mode, and then jump the instruction pointer to the memory address stored in the IVT.
The "Basics" | Putting the "You" in CPUDuring the boot process, the operating system stores a table called an interrupt vector table (IVT; x86-64 calls this the interrupt descriptor table) in RAM and registers it with the CPU. The IVT maps interrupt numbers to handler code pointers.
The "Basics" | Putting the "You" in CPUDuring the boot process, the operating system stores a table called an interrupt vector table (IVT; x86-64 calls this the interrupt descriptor table) in RAM and registers it with the CPU. The IVT maps interrupt numbers to handler code pointers.
The "Basics" | Putting the "You" in CPUUser space to kernel space control transfers are accomplished using a processor feature called software interrupts
The "Basics" | Putting the "You" in CPUPrograms run in user mode because they can’t be trusted with full access to the computer. User mode does its job, preventing access to most of the computer — but programs need to be able to access I/O, allocate memory, and interact with the operating system somehow! To do so, software running in user mode has to ask the operating system kernel for help. The OS can then implement its own security protections to prevent programs from doing anything malicious. If you’ve ever written code that interacts with the OS, you’ll probably recognize functions like open, read, fork, and exit. Below a coupl…
The "Basics" | Putting the "You" in CPUAn example of how processor modes manifest in a real architecture: on x86-64, the current privilege level (CPL) can be read from a register called cs (code segment). Specifically, the CPL is contained in the two least significant bits of the cs register. Those two bits can store x86-64’s four possible rings: ring 0 is kernel mode and ring 3 is user mode. Rings 1 and 2 are designed for running drivers but are only used by a handful of older niche operating systems. If the CPL bits are 11, for example, the CPU is running in ring 3: user mode.
The "Basics" | Putting the "You" in CPUAn example of how processor modes manifest in a real architecture: on x86-64, the current privilege level (CPL) can be read from a register called cs (code segment). Specifically, the CPL is contained in the two least significant bits of the cs register. Those two bits can store x86-64’s four possible rings: ring 0 is kernel mode and ring 3 is user mode. Rings 1 and 2 are designed for running drivers but are only used by a handful of older niche operating systems. If the CPL bits are 11, for example, the CPU is running in ring 3: user mode.
The "Basics" | Putting the "You" in CPUIn kernel mode, anything goes: the CPU is allowed to execute any supported instruction and access any memory. In user mode, only a subset of instructions is allowed, I/O and memory access is limited, and many CPU settings are locked. Generally, the kernel and drivers run in kernel mode while applications run in user mode.
The "Basics" | Putting the "You" in CPUThe mode (sometimes called privilege level or ring) a processor is in controls what it’s allowed to do. Modern architectures have at least two options: kernel/supervisor mode and user mode.
The "Basics" | Putting the "You" in CPUThe kernel, however, is the core of the operating system. When you boot up your computer, the instruction pointer starts at a program somewhere. That program is the kernel. The kernel has near-full access to your computer’s memory, peripherals, and other resources, and is in charge of running software installed on your computer (known as userland programs).
The "Basics" | Putting the "You" in CPUIt turns out CPUs have a super basic worldview; they only see the current instruction pointer and a bit of internal state. Processes are entirely operating system abstractions, not something CPUs natively understand or keep track of.
The "Basics" | Putting the "You" in CPUThe operating system loads this into RAM and instructs the CPU to jump the instruction pointer to that position in RAM. The CPU continues running its fetch-execute cycle as usual, so the program begins executing!
The "Basics" | Putting the "You" in CPUThis instruction pointer is stored in a register. Registers are small storage buckets that are extremely fast for the CPU to read and write to. Each CPU architecture has a fixed set of registers, used for everything from storing temporary values during computations to configuring the processor. Some registers are directly accessible from machine code, like ebx in the earlier diagram. Other registers are only used internally by the CPU, but can often be updated or read using specialized instructions. One example is the instruction pointer, which can’t be read directly but can be updated with, f…
The "Basics" | Putting the "You" in CPUSome instructions can tell the instruction pointer to jump somewhere else instead, or jump different places depending on a certain condition; this makes reusable code and conditional logic possible.
The "Basics" | Putting the "You" in CPUAfter executing an instruction, the pointer moves forward to immediately after the instruction in RAM so that it now points to the next instruction.
The "Basics" | Putting the "You" in CPUThe CPU stores an instruction pointer which points to the location in RAM where it’s going to fetch the next instruction. After executing each instruction, the CPU moves the pointer and repeats. This is the fetch-execute cycle.
The "Basics" | Putting the "You" in CPUThe CPU always reads machine code directly from RAM, and code can’t be run if it isn’t loaded into RAM.
The "Basics" | Putting the "You" in CPUThe “instructions” that CPUs execute are just binary data: a byte or two to represent what instruction is being run (the opcode), followed by whatever data is needed to run the instruction. What we call machine code is nothing but a series of these binary instructions in a row.
The "Basics" | Putting the "You" in CPUIn practice the founders grow with the problems. But no one seems able to foresee that, not even older, more experienced founders. So the reason younger founders have an advantage is that they make two mistakes that cancel each other out. They don't know how much they can grow, but they also don't know how much they'll need to. Older founders only make the first mistake.
Schlep BlindnessHow do you overcome schlep blindness? Frankly, the most valuable antidote to schlep blindness is probably ignorance.
Schlep BlindnessThough the idea of fixing payments was right there in plain sight, they never saw it, because their unconscious mind shrank from the complications involved. You'd have to make deals with banks. How do you do that? Plus you're moving money, so you're going to have to deal with fraud, and people trying to break into your servers. Plus there are probably all sorts of regulations to comply with. It's a lot more intimidating to start a startup like this than a recipe site.
Schlep BlindnessThe most dangerous thing about our dislike of schleps is that much of it is unconscious. Your unconscious won't even let you see ideas that involve painful schleps. That's schlep blindness.
Schlep BlindnessThe most striking example I know of schlep blindness is Stripe, or rather Stripe's idea. For over a decade, every hacker who'd ever had to process payments online knew how painful the experience was. Thousands of people must have known about this problem. And yet when they started startups, they decided to build recipe sites, or aggregators for local events. Why? Why work on problems few care much about and no one will pay for, when you could fix one of the most important components of the world's infrastructure? Because schlep blindness prevented people from even considering the idea of fixin…
Schlep BlindnessThis parental obsession with curating a rich intellectual milieu comes through in nearly all of the biographies.
Childhoods of exceptional people - by Henrik KarlssonVirginia Woolf never attended school. Her father, Leslie Stephen, who, along with their tutors, educated Virginia and her sister, was an editor, critic, and biographer “complicatedly hated” by his daughter and of such standing that he could invite Henry James, Thomas Hardy, and Alfred Lord Tennyson to dine and converse with his children. Leslie Stephen described his circle, in which Virginia grew up, as “most of the literary people of mark . . . clever young writers and barristers, chiefly of the radical persuasion . . . we used to meet on Wednesday and Sunday evenings, to smoke and drink and …
Childhoods of exceptional people - by Henrik KarlssonThese naked apes, the humans, are intensely social animals. They obsessively internalize values, ideas, skills, and desires from the people who surround them. It is therefore not surprising that those who grow up to be exceptional tend to have spent their formative years surrounded by adults who were exceptional.
Childhoods of exceptional people - by Henrik Karlsson