Ring fence CPU for a specific programme / process to stop it using to much I've just had an app run my CPU (as viewed in activity monitor) to 102% whilst it was running a compiling and installation task. 

My machine was basically unusable as a result.

Is it possible to ring fence an amount of CPU for a task, so that 
I could say that this application can utilize no more that 50% of CPU power? Presumably it would make the task around twice as long, but at least I would be able to do other stuff whilst the CPU-hungry app is running. 

My computer is running macOS 10.12.
The figure in Activity Monitor is actually listed as 'percentage of one core' [which is why it can go over 100%] so this is going to depend really on how many cores you have.

I have found the simplest way to get the most out of a task like compiling whilst still being able to use the Mac as normal is to run a VM of your OS in something like Parallels - assigning it exactly your real core-count [ie half of your count including HyperThreading].
In practise, this will mean it uses one of each hyperthread on each core; giving maximum speed with maximum remaining potential.