Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Consider: what proportion of programmers have taken an OS course? Specifically OSes, 'cause I know that virtual memory was not covered in any of the computer architecture courses I've taken.

Now, how many of those programmers who know about virtual memory (larger than the number who have taken a course on operating systems, but still far from 100%, I'd wager) have actually realized "hey, virtual memory can make it so that I never have to explicitly write stuff to disk?" I certainly hadn't.

Just because you expect people to know basic concepts, doesn't mean that an article explaining what they're useful for is useless. Quite the opposite, in fact.



My experience has been that most programmers are more or less clueless about how virtual memory works. At best, they understand it as letting you swap out memory to disk when memory runs low.

Even ignoring Kamp's "mmap the world" approach, if I brought up any of his other ideas in a meeting with most programmers, there'd be immediate cries of premature optimization (and reinventing the wheel, in the case of using a single malloc'd chunk for workspaces). Never mind what we're talking about building or what we already know about the performance of different approaches, and never mind that a lot of important performance decisions are architectural and are a lot harder to change later on.

These ideas just aren't on most programmers' radar—it's all evil voodoo to be avoided at all costs to them.

How many programmers know the effect of a write from one CPU on the next read from another CPU on the same cache line? How many programmers know the relative cost of a syscall vs. a function call? How many programmers ever think about optimizing their use of CPU cache?

Most of the time they get away with ignoring these things because they really don't matter in context. But sometimes they don't get away with it because these things do matter, and in those moments I wish more programmers had a better understanding of their machines and their operating systems.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: