Threaded dreams

There is an urban legend that drinking tequilla before going to sleep will guarantee you some really cool colorful dreams. Unfortunately, that’s more than an urban legend. I’ve tried it myself several times and it never worked out.

But another thing that I’ve tried myself and that worked out just fine, but which I haven’t heard anyone talking about, is threaded dreams.

What are threaded dreams? Well, threaded dreams are those that you (or should I say – I) have after programming threads or forks too much. I’ve always had a suspecion about the existance of threaded dreams, but I never had to program threads often enough to notice the trend.

This month though confirmed my suspecions a few times in a row. Two of these dreams were particularly interesting.

First dream I had after programming straight for about 10 hours. I was tired and my brain was steaming. The last couple of hours were spent on solving the problem of slow forks and loosing control over fork counts (fork bombs). When I wen to bed, I had a dream that I was inside my own computer program. It wasn’t anything like The Matrix I should say. It was more like a huge stone cave with very heigh ceilings. I was walking around, studing it, but somehow I managed to upset the program and it got angry with me. Huge stone chunks of code were falling from the top all over the place, trying to kill me. Gladly I managed to make my way somehow towards a debugger. A debugger was this strange virtual thingy which allowed me to pause the falling blocks of code and change the program in a such a way that they would either disappear or drop somewhere nearby, missing me safely. It was a tedious task, but I managed to survive.

Another dream happenned few days later when I was working with native POSIX threads in Python. I had more difficult problems than the first time around, but I spent less hours solving them. When I went to bed, I had a dream that I am one of the threads inside my own program. And, as any other thread, I had some job to do. Somehow I managed to finish the job very fast, and the program was trying to kill me, as I was not needed anymore. Needless to say, I wanted to stay alive. I was trying to find something else to do. I was cleaning memory with the broom, polishing the CPU with washclothes, running back and forward delivering all sorts of resources between other threads, and performing many other low-skill tasks that a respected thread shouldn’t be performing. Gladly I woke up before the program managed to kill me.

I still have a few more tasks, involving threads, to work on. I’ll see if those will result in any weird dreams. But so far, so good – threaded dreams is my own urban legend.

Leave a Comment