I am creating a shell which can spawn programs in the background. When a program starts to use a certain amount of memory, like 100MB, I want an interrupt to be triggered that will cause a function to run. The alternative is to have a process keep running and checking the status of background processes. Using an interrupt seems to use less CPU resources. Is that correct? Is it possible to do this?
I'm trying to do this in Linux.