free html hit counter
Posted on: Friday, June 25, 2010 by Rajiv Popat

Programmer Tip: Reducing Your Parallel Threads And Prioritizing Your Free Time.

I just promised someone I'll do a talk in their conference. He wants a copy of the presentation I am going to deliver at the conference. I have two unfinished drafts of blog posts sitting in my drafts folder. There is a side project that I need to be working on.

I am out with my family, eating in an amazing Italian restaurant. There is some shopping that I need to do. The book that I started working on is on a stand still, unfinished, grabbing me by collar and asking me to give it the finishing touches it deserves.

Put simply, I am on a thread dead-lock as I desperately try to figure out which thread to take up and process next.

It is something fairly similar to your machine's processor choking with too many applications running and each ALT+TAB takes you seconds to switch.

The conference cannot wait, neither can the blog posts but it is time to choose between the book or the side project. A decision has to be made,  a thread needs to be ended and a door needs to be closed. At-least temporarily.

Dan Ariely in his absolutely amazing book, Predictably Irrational talks about the inherent fear that we as human beings have towards closing doors. He used experiments which included observing students while they played a computer game designed specially for the experiment to observe how human beings react to the idea of closing doors. He explains:

To find out, we changed the game. This time, any door left unvisited for 12 clicks would disappear forever. SAM, A RESIDENT of the hackers' hall, was our first participant in the "disappearing" condition. He chose the blue door to begin with; and after entering it, he clicked three times.

His earnings began building at the bottom of the screen, but this wasn't the only activity that caught his eye. With each additional click, the other doors diminished by one-twelfth, signifying that if not attended to, they would vanish. Eight more clicks and they would disappear forever. Sam wasn't about to let that happen. Swinging his cursor around, he clicked on the red door, brought it up to its full size, and clicked three times inside the red room. But now he noticed the green door—it was four clicks from disappearing.

Once again, he moved his cursor, this time restoring the green door to its full size. The green door appeared to be delivering the highest payout. So should he stay there? (Remember that each room had a range of payouts. So Sam could not be completely convinced that the green door was actually the best. The blue might have been better, or perhaps the red, or maybe neither.) With a frenzied look in his eye, Sam swung his cursor across the screen. He clicked the red door and watched the blue door continue to shrink.

After a few clicks in the red, he jumped over to the blue. But by now the green was beginning to get dangerously small—and so he was back there next. Before long, Sam was racing from one option to another, his body leaning tensely into the game. In my mind I pictured a typically harried parent, rushing kids from one activity to the next.

Is this an efficient way to live our lives—especially when another door or two is added every week?

I can't tell you the answer for certain in terms of your personal life, but in our experiments we saw clearly that running from pillar to post was not only stressful but uneconomical. In fact, in their frenzy to keep doors from shutting, our participants ended up making substantially less money (about 15 percent less) than the participants who didn't have to deal with closing doors.

The truth is that they could have made more money by picking a room—any room—and merely staying there for the whole experiment!  (Think about that in terms of your life or career.)

When Jiwoong and I tilted the experiments against keeping options open, the results were still the same. For instance, we made each click opening a door cost three cents, so that the cost was not just the loss of a click (an opportunity cost) but also a direct financial loss. There was no difference in response from our participants. They still had the same irrational excitement about keeping their options open.

As human beings in general and as programmers in particular we are hugely attached to the idea of keeping our options open, keeping multiple choices in our lives and getting involved with multiple projects. On one hand, we have programmers who cannot program and 501 developers. On the other we have folks who are working on so many different things and trying so hard to keep all of these efforts alive that none of them ultimately see the day of light.

For me, it was this secret project of mine, that would have to wait. I am closing a door for the time being, so that I can focus on another one and so that the book can reach a meaningful logical milestone.

If you are getting bogged down with too many side-projects to work on, too many speaking engagements, too many things to do and you find yourself handling multiple threads even on weekends, maybe its time to take a pause, evaluate and close a few doors. The least you can do is close them temporarily and then come back to them at a later time.


Focus on what is really important to you, even if it means closing a few doors of your life so that you can focus on the ones that mean a lot more to you..

Go ahead, pick a few assignments or projects that can wait and either end them or put them on hold temporarily.

I wish you good luck.