The hidden costs of the multi-tasking software developer
We software developers work with words for a living. We have words for everything. At the drop of a hat, we will appropriate an existing English word/phrase and bend it to some new purpose. Words like "function" or "service" or "filter" for example. Phrases like "load balancing" or "multiple inheritance" or "context switching"...
Hang on a moment. That last one is a bit different I think. Back up the truck a little here. The flow of language I speak of is not all one way. There are times when the software world has a word/phrase for something which flows from geekdom into the mainstream. This is one of them I think.
Yesterday, a colleague complained that the timesheet system we use at my day job does not have an entry for context switching[1]. The geeks in the room knew immediately what she meant but everyone else was baffled.
The phrase relates to a common computing concept of a single CPU juggling many tasks at the same time. In order to give the illusion that lots of things are going on at the same time, the CPU jumps very quickly between a bunch of separate tasks creating the illusion of parallel activity.
Obviously, for this to be an effective strategy, the time it takes to switch from one task to another, is critical. This process is known as context switching and CPUs typically do it very, very quickly indeed.
For human beings however, context switching is a much, much slower process. Consider a software developer working on multiple, distinct projects at various times. If the a.m. is to be spent on project A, that can easily go into the timesheet. No problem. If the afternoon is to be spent on project B, adding that to the timesheet is a little more problematic. The problem arises from the non-trivial amount of time it can take to mentally switch from project A to project B. The time involved can be anything from minutes to hours and even days.
Over the course of a year, this time can really add up and it can be infernally difficult to explain to non-technical folk why context switching can be so time consuming. In extreme cases, developers can spend more time context switching between projects than they do actually making progress on any project.
Which brings to mind another phrase us developers like to use -- a "disk thrashing"[2]. This occurs when there isn't enough memory and stuff needs to be parked to disk only to be hauled in again, the next time the context switches.
It is easy to spot when this happens as the machine tends to make unpleasant whirring noises and flash red a lot. Come to think of it, this is often the best way of spotting developers caught in endless context switches too.
[1] http://en.wikipedia.org/wiki/Context_switch
[2] http://www.webopedia.com/TERM/D/disk_thrashing.html
ITworld.com
Sign up for ITworld's Daily newsletter
Follow ITworld on Twitter @IT_world
Esther Schindler
If the comments are ugly, the code is ugly
claird
SVG a graphics format for 21st century
pasmith
Take Chrome OS for a test spin
Sandra Henry-Stocker
Solaris Tip: Have Your Files Changed Since Installation?
jfruh
Android fragments vs. the iPhone monolith
mikelgan
What Gizmodo missed about the Pro WX Wireless USB disk drive
Sidekick: The Good News & the Bad News
Either way you look at it Microsoft Data Center management did not follow standards or best practices in this failure. In which case it makes me wonder more about the outsourcing of corporate data much less personal data.
- mburton325
Join the conversation here
Quick, practical advice for IT pros. Made fresh daily.
Want to cash in on your IT savvy? Send your tip to tips@itworld.com. If we post it, we'll send you a $25 Amazon e-gift card.













