how do you control cpu usage of apps?

view story

http://crunchbanglinux.org – on windows there were at least 2 good apps to control the percentage of cpu an app could hog.so you could set say firefox to only allow it 80% tops, that way your system wouldn't freeze up. Before anyone says you dont need that on linux - just today it happened to me whilst running a bash script (that uses imagemagick) to rezize a couple of photosanyone use an app on Crunchbang to control things? (HowTos)