Jun 01, 2015

Hard Drive RPM Limits

Here is a quick listing of the real limitations of hard drive RPM as found in a post by TheSSDGuy. The comments underneath the article held a wealth of information, which I've consolidated here.

Source: Why Don't HDDs Spin Faster Than 15k RPM

It is not because the disc might break the speed of sound:

  • A 3.5" disc requires 73,105 RPM to break the sound barrier. The real reason is power consumption, which increases disproportionately with speed.
  • Multiple arms can't be used to increase throughput since at high speeds each arm causes turbuence that makes flying low hard.
  • At high speeds disk substrates (metal or glass) would stretch or disentigrate.
  • Higher speeds also magnify high-frequency flutter.
  • It takes time to ramp up the charge on the write head. As the speed increases the capacity of the disc decreases (unless the write head charge can be sped up).
  • Rotational delay is much less than seek delay, so wrong bottleneck.

May 14, 2015

Concurrency and Painting

This metaphor comes from Herlihy's The Art of Multiprocessor Programming; maybe in the future I'll extend it.

Multiprocessor synchronization and Concurrency is painting a house. You have four workers, two brushes, one roller, one ladder, and one giant can of paint. The goal here is to paint the house as fast as possible.

But having four workers isn't four times as good as having a single one - they have to share brushes and paint trays and ladders. This is called Amdahl's Law which says that the theoretical speedup of multiple painters is equivalent to: 1/(B + 1/n(1 - B)), where B is the work that can not be done at the same time.

A deadlock occurs when two painters each are waiting on the other. One has a paintbrush and desires the paint can, while the other has the can and requires the brush. Often times this can be avoided by making sure resources are acquired in a particular order ie. Everyone acquires paint before picking up a brush.

Dec 25, 2014

iTunes 11 and mp3 files

"I can't import mp3 files into iTunes 11" you say. I hear your pain.

Disclaimer, I am not importing music from audio CDs. If you're looking to do that look at the apple documentation here.


There are various ways of 'importing' an audio file into iTunes. You can drag and drop it into the window (you even get a little green plus), you can 'open with iTunes', and you can iTunes-> File-> Import Media. If none of these worked for you, you're not alone.

You might have thought to change various import settings. Nope! Those won't help you. They are geared towards importing CDs.

If you see a thread on Apple support telling you to download and compile some program to check the mp3 for 'encoding errors', ignore it.


You need to change the file format of the mp3. iTunes doesn't like to work with mp3s, it much prefers .m4a files. Don't Panic! Before you run out to purchase some sort of audio conversion software remember, you have Quicktime. Luckily Quicktime can convert your file and send it straight to iTunes.

How to send your mp3 to iTunes

  1. Open your mp3 in Quicktime (make sure it plays)
  2. Quicktime Player -> File -> Export -> iTunes...
  3. Wait for it to complete.
  4. Check your iTunes library for the new file. I'd check the 'Recently added' smart playlist.

Hopefully this works for you :)

But Wait a Minute...

Why was this so hard? Why did iTunes fail silently whenever we tried to import an mp3 file? Is it too difficult to tell the user what is the matter? Furthermore, Apple definitely knows how to convert this kind of file. Why wasn't that an option?

I think the answer is one of business. Apple wants you to buy your music from the iTunes store. If you already have audio CDs you are allowed to migrate to iTunes, but music from other digital music retailers is discouraged. After all, importing a CD is handled very gracefully by iTunes, therefore any other digital media must have been obtained through competitors.

Failing silently is very poor taste.