The internals of Google's pprof CPU Profiler (for C++ and Go). Comments here appear on the blog post.
research!rsc: How To Build a User-Level CPU Profiler
212 plus ones
Shared publicly•View activity
View 10 previous comments
- This reminds of a user-space threading library I was writing, which implemented task preemption by using setitimer() as well.
Interesting read.Aug 9, 2013
- Sorry but I stopped reading at the point where you brought up MSDOS and iOS3 as examples of operating systems without multitasking... iOS3 is essentially Darwin, with exactly the same XNU kernel used on desktop Darwin (MacOS X), and it's perfectly capable of multitasking, as all UNIX systems are. The "multitasking" feature of iOS is just a marketing term, for how its shell operates. Nothing to do with the kernel and multitasking as the ability to switch execution contexts as you where describing, and which MSDOS lacks.Aug 11, 2013
- Interesting, thanks. I don't program for iOS myself, I just know what is reported by others. So how did early iOS stop apps from actually doing background work? Did it kill the app when you switched away from it?Aug 13, 2013
Not killed directly. What used to happen, and still happens unless the app notifies the system that it wants to continue doing background work, is that it's put to sleep when the user hits the home button. It's removed from the runqueue, after being given a chance through some kind of "stop" event to save its state, and from that point on it can be killed at any moment the system detects a low memory condition.Aug 17, 2013
- This is very interesting. It's a great approach.Jan 14, 2014
- Great post.Jan 15, 2014
Add a comment...