That's an Ubuntu problem and not an Linux problem thank goodness.
UNIX priorities don't handle this situation well because a low priority process is still technically immediately runnable and can cause priority inversions by clearing out all kinds of system caches that your foreground app was using.