A more nuanced control is to throttle down the CPU, via cputhrottle[1].
If I'm running a CPU-intensive calculation and don't want to bog down the rest of my system I will use it to give me enough cycles for Sublime Text to work smoothly. It's easy to call:
It may be, but it doesn't solve some of the problems that cputhrottle does. My main use for cputhrottle is to limit the CPU usage of Flash. It's not that I want to use the CPU for something else, at least not at the moment, but I don't want my laptop's fans to turn on, the whole thing to heat up and it to kill my battery life. [re]nice will only allow another process to get CPU priority, it won't keep the CPU utilization low.
The bizarre part, when it comes to Flash, is that I've yet to see an actual difference in the application behavior when I throttle down it's CPU usage. I would think that if it normally maxes out 7 of my 8 logical cores, being limited to 40% of one core would make introduce slowness. But I guess that's just an indication of how poorly written the OS X flash client it.
Nice solves a different problem: Making sure that less important programs don't hog cpu time.
I use cpulimit to force a CPU bound program to slow down. I also use it for programs that always max out the CPU for no good reason, and work fine with less CPU. Nice won't help with either of those.
Where it gets more interesting is using elaborate checkpoint/restore [1] mechanisms for processes to serialize their state (open fds, watches, IPC, etc.) into an image that can then be overlayed, remotely executed, debugged and so forth. [1] https://en.wikipedia.org/wiki/Application_checkpointing
I've always thought this was a wrongheaded solution.
I mean, of course, we have these apps that splay themselves all over global system resources in complex ways, and so we need to track down how they've done that, record it, and then replay it later to restore them. It's necessary. But imagine a well-behaved classical X11 app, running in something like a VM or Docker container. You execute its launcher, the VM spins up in the background, the app launches in the VM, and the app's X11 client connects to the X11 server you're staring at and displays things. If we truly want to sandbox apps, wouldn't it make more sense to move more toward a model like that—one where you have a discrete "application backend process" running in a sandbox, and you can just chuck around the sandbox itself willy-nilly (freezing it, thawing it, copying it, etc.) because it has well-defined connection-points to the host?
The purpose of C/R isn't sandboxing, it has nothing to do with it. It's about managing internal state and data structures from an external agent.
C/R enables complete persistence by duplicating a process from its image, which can cut initialization and startup times by orders of magnitude, and resume service from an exact position with zero downtime, and not just basic mechanisms like socket superservers. It lets you back up process state at any arbitrary moment, send it over the network, recalculate and reexec immediately and then thaw again for debugging it from that particular point. It just helps enable live migrations and zero downtime recoordinations with far less complicated redundancy schemes. This includes containers. On top of it being a universal save/pause button. Depending on the robustness of the image format, it can be made space efficient through deduplication. C/R is quite invaluable for any scenario that involves fault tolerance, high response times, tracking down difficult bugs, low startup overhead and so on. I'm surprised why it's still such an obscure technique. Besides, I don't think the primary use case here is even graphical apps (not that they don't work just fine). What you really want is a local indexed copy of all the execution environment details, like pipes, sockets, timers, ttys, timers, sigmasks, *fds, etc. for infrastructure.
"This is nice! On OSX, processes can be paused and continued too"
Every once in a while I am reminded how wonderful, and perhaps unlikely, it is that I have a nice, slick, mass market consumer device (apple computer running OS X) that is honest to god UNIX underneath. And then sad, knowing that this is a brief golden age that will probably pass.
As someone who just switched to Linux from OS X, it is really hard to migrate. I miss the subtleties of the apple ecosystem. Sure Linux is awesome, but I have been battling trackpad support issues, keymapping the super_key to CMD, and just general battling the UX.
tl;dr a more powerful operating system with worse UI, which is the obvious trade. A less powerful system with a fantastic UI.
Linux is a lot of good things, but "slicker than OS X" (in the sense of basic user-friendliness to the average computer user) is not really one of them.
Many would argue the golden age of OS X and nix compatibility has already passed. The last time I seriously used OS X was 10.4, but every release I hear about another set ofnix compatibilities getting chipped away.
> New operating systems today tend to be just ways of
reimplementing Unix. If they have a novel architecture -- and some do -- the first thing to build is the Unix emulation layer.
> How can operating systems research be relevant when the
resulting operating systems are all indistinguishable? > There was a claim in the late 1970s and early 1980s that Unix
had killed operating systems research because no one would
try anything else. At the time, I didn’t believe it. Today, I
grudgingly accept that the claim may be true (Microsoft
notwithstanding). > A victim of its own success: portability led to ubiquity. That
meant architecture didn’t matter, so now there’s only one.
Linux is the hot new thing... but it’s just another Unix. http://herpolhode.com/rob/utah2000.pdf
Great app but I have one request. Can you please modify it so instead of pausing the game until my SO is done talking, it pauses my SO until my game is done its cutscene? Thanks in advance.
This should be a basic requirement for all games. Even before I was married my mom would call or someone would ring the doorbell. And when I was a kid I had to go down to dinner or take out the trash.
"Tricks of the Mac Game Programming Gurus [<a href="http://www.amazon.com/Tricks-Mac-Game-Programming-Gurus/dp/1568301839]"" rel="nofollow">http://www.amazon.com/Tricks-Mac-Game-Programming-Gurus/dp/1...</a> actually dedicated about a paragraph or two to the topic, driving home the point that a game that cannot be paused is leaving N% of potential players on the table right out of the starting gate (and I believe they even had a hypothetical about "little Jimmy" not being able to pause to take out the trash and therefore his parents uninstall the game).<p>These days of MMOs and other coordinated time-sinks make me miss the simplicity of pausable single-player and turn-based multiplayer sometimes.
That is probably 90% of the reason I stopped playing multiplayer games. Which sucks because the number of single player games I want to play is, I feel, getting smaller over the years. There was a day when first person shooters, no matter how good the multiplayer was, had a single player campaign as well. There was a day (even when processors were absolute shit) when you could add bots into the game and they would play like humans with personalities.
Hell, even the single player games are getting to be unpausable. How many cut scenes are there in GTAV? And if other duties are at hand, the only option is to skip the story line so you can pause.
One problem with real-time multiplayer games is also the sensitivity to latency. It can very easily be impossible to play any game that is sensitive to latency together with people from several continents. I'd wish there'd be more games that don't rely on fast connections. CIV 5 is good exception, with it's well though-out multiplayer modes.
It's why I love the Nintendo DS and its successor the 3DS - any game can be paused just by closing the lid! In this low-power mode it can last for many hours, possibly days.
Years ago, I wondered why hypervisor-level pause (and memory snapshots, for that matter) weren't just expected features for game consoles.
These days I can at least hit the Home button on a Wii U game and expect it to work. Emulators are still hogging save-states all to themselves, though.
Now, I only need a similar tool that kills the process with the highest CPU and MEMORY load with a short cut. Reasons: Sometimes a process leaks memory and fills up 16GB RAM and opening a new process like taskmgr is impossible to severe paging-IO. Sometimes a full screen application crash and spawns a modal crash dialog behind the full screen window so only taskmgr and keyboard usage works (as the mouse is hidden by the crashed full screen app).
Comments (169) 37 threads
If I'm running a CPU-intensive calculation and don't want to bog down the rest of my system I will use it to give me enough cycles for Sublime Text to work smoothly.
ex. 1. http://www.willnolan.com/cputhrottle/cputhrottle.htmlIt's easy to call:
https://github.com/archagon/app-pauser
It works pretty good, but I have had flash games crash if you limit them too low for a while.
Continue this thread — 1 reply
The bizarre part, when it comes to Flash, is that I've yet to see an actual difference in the application behavior when I throttle down it's CPU usage. I would think that if it normally maxes out 7 of my 8 logical cores, being limited to 40% of one core would make introduce slowness. But I guess that's just an indication of how poorly written the OS X flash client it.
Continue this thread — 4 replies
I use cpulimit to force a CPU bound program to slow down. I also use it for programs that always max out the CPU for no good reason, and work fine with less CPU.
Nice won't help with either of those.
Where it gets more interesting is using elaborate checkpoint/restore [1] mechanisms for processes to serialize their state (open fds, watches, IPC, etc.) into an image that can then be overlayed, remotely executed, debugged and so forth.
[1] https://en.wikipedia.org/wiki/Application_checkpointing
I mean, of course, we have these apps that splay themselves all over global system resources in complex ways, and so we need to track down how they've done that, record it, and then replay it later to restore them. It's necessary.
But imagine a well-behaved classical X11 app, running in something like a VM or Docker container. You execute its launcher, the VM spins up in the background, the app launches in the VM, and the app's X11 client connects to the X11 server you're staring at and displays things.
If we truly want to sandbox apps, wouldn't it make more sense to move more toward a model like that—one where you have a discrete "application backend process" running in a sandbox, and you can just chuck around the sandbox itself willy-nilly (freezing it, thawing it, copying it, etc.) because it has well-defined connection-points to the host?
C/R enables complete persistence by duplicating a process from its image, which can cut initialization and startup times by orders of magnitude, and resume service from an exact position with zero downtime, and not just basic mechanisms like socket superservers.
It lets you back up process state at any arbitrary moment, send it over the network, recalculate and reexec immediately and then thaw again for debugging it from that particular point.
It just helps enable live migrations and zero downtime recoordinations with far less complicated redundancy schemes. This includes containers. On top of it being a universal save/pause button.
Depending on the robustness of the image format, it can be made space efficient through deduplication.
C/R is quite invaluable for any scenario that involves fault tolerance, high response times, tracking down difficult bugs, low startup overhead and so on. I'm surprised why it's still such an obscure technique.
Besides, I don't think the primary use case here is even graphical apps (not that they don't work just fine). What you really want is a local indexed copy of all the execution environment details, like pipes, sockets, timers, ttys, timers, sigmasks, *fds, etc. for infrastructure.
Every once in a while I am reminded how wonderful, and perhaps unlikely, it is that I have a nice, slick, mass market consumer device (apple computer running OS X) that is honest to god UNIX underneath.
And then sad, knowing that this is a brief golden age that will probably pass.
We have also seen an incremental approach in the gradual replacement of open APIs/components with closed ones.
tl;dr a more powerful operating system with worse UI, which is the obvious trade. A less powerful system with a fantastic UI.
Continue this thread — 23 replies
> How can operating systems research be relevant when the resulting operating systems are all indistinguishable?
> There was a claim in the late 1970s and early 1980s that Unix had killed operating systems research because no one would try anything else. At the time, I didn’t believe it. Today, I grudgingly accept that the claim may be true (Microsoft notwithstanding).
> A victim of its own success: portability led to ubiquity. That meant architecture didn’t matter, so now there’s only one. Linux is the hot new thing... but it’s just another Unix.
http://herpolhode.com/rob/utah2000.pdf
Hell, even the single player games are getting to be unpausable. How many cut scenes are there in GTAV? And if other duties are at hand, the only option is to skip the story line so you can pause.
These days I can at least hit the Home button on a Wii U game and expect it to work. Emulators are still hogging save-states all to themselves, though.
Now, I only need a similar tool that kills the process with the highest CPU and MEMORY load with a short cut. Reasons: Sometimes a process leaks memory and fills up 16GB RAM and opening a new process like taskmgr is impossible to severe paging-IO. Sometimes a full screen application crash and spawns a modal crash dialog behind the full screen window so only taskmgr and keyboard usage works (as the mouse is hidden by the crashed full screen app).
Continue this thread — 4 replies
All comments shown.
Couldn't load more comments. Check your connection and try again.