That would be a **** desktop app. Even desktop apps do that today as 'desktop' includes being mobile on battery. Some OSs also actively power down apps reducing priority. Eg. MacOS has 'App Naps' to conserve battery life.
Multitasking, meaning you decide when your app dies, can apparently be improved using apps or xposed modules...