The hidden costs of the multi-tasking software developer

October 19, 2007, 02:40 PM —  ITworld.com — 

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

I like it!
Post a comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
peer-to-peer

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?

sjvn
64-bits of protection?

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

The Daily Tip

The Daily TipQuick, practical advice for IT pros. Made fresh daily.

Hot tips:

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.

Newsletters

Subscribe to ITWORLD TODAY and receive the latest IT news and analysis.

I would like to receive offers via email from ITworld partners.
By clicking submit you agree to the terms and conditions outlined in ITworld's privacy policy.
Featured Sponsor

AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.

In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability and performance at a fraction of traditional cost.

On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.

Marketplace