dannyman.toldme.com

About Me : Free Style : Good Reads : News and Reaction : Photographs : Technical : Travels : Unsorted

Search:
July 27, 2007
Good Reads, Technical

Tonight We’re Going to Program Like its 1975!

Interesting, enjoying, and even funny technical read from Poul-Henning Kamp: Architect Notes for the Varnish HTTP Accelerator

His big point is that programmers need to stop fretting over moving things between memory and disk themselves. He explains that on a modern computer system, RAM is backed by disk, and disk accesses are buffered in RAM, and a lot of work goes in to the kernel to ensure that the system behaves effectively. By managing your own RAM-or-disk conundrum, you end up making a mess of things, because when you go to move an unused “memory” object to disk, the kernel may already have paged the memory region to disk, and what happens is the object then must move from virtual memory on disk, to RAM, to a disk memory cache in RAM, and then back out to disk. It is simpler and more efficient to just ask for a big chunk of memory and let the kernel page things to disk for you.

He then explains some clever things you can do for multi-processor programming. It seems to boil down to trying to give threads their own stack space wherever practical, and managing worker pools as a stack, so that you are most likely to find yourself processing on the same CPU at the lowest level of cache, and least likely to need to pass memory variables between CPUs.

Not that I write multi-threaded applications, but if I ever do, I’ll try to keep this understanding in mind.

Read More

Next:
Previous:
Categories: Good Reads, Technical
Possibly-Related Posts
Open Source Projects Could Augment CS Curricula
Week of 20 December, 2009
Transit Etiquette
Dream: “Scramble Time at a Methadone Clinic”
Notes on Porting a Django App from SQLite to MySQL
Snapshot: My E-mail Archive
Iowa!

Response

July 27th, 2007

Mike

Thanks for the link. I really like it when people write articles like this.

Comment

Leave a comment . . .

  1. You must provide an e-mail address.
  2. First-time comments will be held for review.
  3. Bogus e-mail addresses are lame, but will work.
  4. For private messages, e-mail me: dannyman@toldme.com.
  5. I will not spam you, and I will not publish or share your e-mail address.