The assumption is that the joke has enough humour to be ruined by an explanation. But to decide that, you need to understand the joke. Oh…
The following conversation took place on Facebook recently. The geeks responsible have been anonymised to protect the guilty:
- A: My life needs an O(1) scheduler.
- B: Are you sure you don’t need a completely fair scheduler?
- C: Do you find your life is a bit too co-operative, run-to-completion at the moment?
So what are we talking about here? Person A is obviously having some issues with their life. To work out what kind of problems, we need to know what a scheduler does, and what an O(1) scheduler is used for. (By the way, that’s pronounced “order 1 scheduler”.) Small digression time…
Process scheduling
I think it’s fair to say that all general purpose computers nowadays allow multitasking. This is a feature of the operating system, and it’s certainly available for Windows, Mac OSX and anything else you use. The actual multitasking is possible by dividing time into discrete little chunks and doing one thing within each time chunk. Taken across a long time frame it looks like many things are happening at once.
(This may seem a strange thing to say — after all, there’s no multitasking taking place. But then we are just as guilty of this in everyday conversation. I may say that I’m working on three things at the moment, but the truth is that I can only focus my mind on one thing at a time. And even then the mental effort of shifting focus from one task to another causes enormous slowdown, so there are large periods of time when I’m not doing anything. But I’d still say I’m doing three things at the moment, because over a large enough scale, like a working day, that is what I do.)
The computer only does one thing at a time, but very quickly. In human terms they all happen at once, but there is an order of events. Determining which process to run next is the job of the scheduler. There are many ways to write a scheduler, depending on what type of programs you will be running. File servers have different needs from games machines. Do you want to give every process a fair go, or do programs that the user is aware of deserve more attention?
One important consideration is that the scheduler be predictable. For example, you may want it to decide on the next task to schedule within a set time frame. It’s no good if your scheduler is really quick when choosing among three choices, but takes forever to choose between three thousand. A scheduler that chooses the next task in a constant time, no matter how many things there are to choose from, is called a O(1) scheduler. The reason for the name is a bit technical for this discussion, so you’ll just have to take my word for the meaning of this strange terminology.
Too many choices
Having now covered a bit of ground regarding schedulers, we can apply our knowledge to the life of person A. They want a scheduler, so they’re obviously feeling a bit overwhelmed by things they need to do. More importantly, they’re looking for a scheduler that will make choices at a predictable pace — so that even when they are overwhelmed, their scheduler will remain unflustered. Maybe person A is feeling a bit panicked by their hectic lifestyle, and paralysed by the number of things they need to do?
The suggestion of person B is that a completely fair scheduler would be preferable. With some schedulers a process can be penalised if they only need to do things occasionally. Processes which constantly demand attention will get more attention — like the cuckoo chick that demands to be fed constantly. This can starve other processes, so they seem to be acting sluggishly. Unfortunately it’s the programs which users interact with that are the “occasional” users, so when the user finally does something there will be a noticeable, and irritating, delay. Completely fair schedulers are optimised for this situation, to make the system seem more responsive.
I’m not sure what this means for scheduling person A’s life — maybe they need to spend less of their attention on things which make lots of demands. Another way of telling someone to focus on their “work/life balance”?
And finally we come to person C, who suggests that person A’s life “a bit too co-operative, run-to-completion”. These are again terms to talk about task scheduling. Back in the bad old days, before “proper” multi-tasking, programs had to let other processes have some time on the processor. The operating system didn’t enforce this, and there were many badly-behaved programs which didn’t stand aside. This is how Mac OS used to work in the Classic days. Maybe person A has many things to do that “will just take five minutes” but in fact never seem to end, and prevent other things from being done.
A run-to-completion system prevents higher priority processes from taking precedence. All processes take the full amount of time to do their work, even if there is something which the operating system deems to be more worthy of attention — like responding to user actions.
So person C is referring to tasks which not only take control of your life, but never seem to let go again. Even in the case where you know there are more important things to do.