Living with a Ghost
Your house has a ghost. Most of the time as you go about your business, nothing eventful happens, but occasionally you notice weird things. Usually it's harmless stuff, you turn off a light, then it turns back on. Sometimes you hear the toilet flushing randomly or the radio turn on. And every once in a while, a sharp knife just floats out of the kitchen drawer and comes at your face.

It's quite terrifying, stuff just moves around on its own!
But then one day you come across an Ouija board and you decide to communicate with the ghost. Turns out the ghost is a nice fellow and isn't trying to harm you. Not at all, in fact, he's similarly jeopardized by your activities (he said you've almost stabbed him 4 times!). He says he's not leaving, he needs to live in the house the same as you. But he's a reasonable ghost and you work out a system where you can both live in the same house, share the same stuff and not stab each other in the face.
You quickly figure out for many things in the house there is only one of you who ever use it, so those things will need no coordination. And for some things it doesn't matter if you both try use it. Like the couch, it's not a problem if you both sit on it, it still works just fine as a couch. That's what couches do, they allow many people to REST simultaneously.

Ghost reading Chicken Soup for the Soul
Other things require some coordination, like the shower and stove. So you devise ways to signal to the other side when you are going to use it, like putting a piece of tape on the stove to show its being used, and if there is tape already on there you wait until its gone before you use it. This mostly works, but sometimes you suspect it's not as efficient as you'd like. Most of the time when the ghost has his tape on it he's only using one burner and sometimes the stove isn't even on. What the hell is he doing over there?
Occasionally the ghost or you get a little confused about the coordination procedures and who's allowed to use what and then accidents happen. Stuff gets spilled and things get lost. It sucks, and sometimes causes a big giant mess for everyone, but for the really important things you guys are pretty careful and bad stuff doesn't happen. Much.
You'd like to move somewhere without ghosts, but you find out pretty much every house in town is this way. Some houses have more than one ghost. Some of the really big houses have dozens, hundreds, even thousands of ghosts. You've been warned to avoid those houses, most people quickly go insane trying to live there. One ghost is bad enough.
But there is one neighborhood you've heard of where there are no ghosts, things always behave consistently and rationally, nothing ever magically moves or changes before your eyes, knives never suddenly fly at your face. It's rumored to be pretty expensive to live there, you hear only the richest, most vitally important people live there. While you don't have the exact figures you know you probably can't afford it, not with your meager resources. No way.
So you go on living with ghosts.

Twist ending: The other side wasn't a ghost, it was M. Night Shyamalan and this whole story was really about the problems of shared state threading (try to act surprised). Take that Hollywood!
Posted October 23, 2006 12:03 AM
Comments
I want you to know that I do not use this metaphorically, I only say it when it is the literal truth: LOL.
And also a decent illustration of the fundamental argument.
Jeremy Bowers, October 24, 2006 1:42 PM
What I find inconvienient is that there's no way to separate bettween "I'm reading, anyone else can read, but no one write", and "I'm writing, don't read".
Anonymous, October 24, 2006 1:55 PM
I am reminded of the movie "The Others". A haunted house story with an interesting twist.
steve, October 24, 2006 9:15 PM
Yeah I also was reminded of "The Others" while writing this. I dug that movie.
Damien, October 24, 2006 11:16 PM
*applauds*
A wonderful little story. Thank you very much!
Philip Storry, October 25, 2006 4:38 AM
Reader writer locks
http://msdn2.microsoft.com/en-US/library/bz6sth95.aspx
It's not so hard to roll your own with just regular locks.
More here: http://en.wikipedia.org/wiki/Reader-writer_lock
and in Google.
Lou, October 31, 2006 1:06 PM
Great story! But ya know, the Erlang neighborhood isn't all that expensive ;)
dennis, November 1, 2006 9:41 AM
Threads, doh! Until the end, I thought you were talking about version control systems :)
Great article.
Blake Chaffin, November 6, 2006 4:48 PM
We think that these stories are really awesome,totally!!! I love you guys and the dead people 2!!!!!!!!
peace out my homie-g's
ps sweet
mary worth the 1st, November 17, 2006 11:39 AM
*You guys are so good at this stuff.We want to *be
just like you guys.have fun for ever.I like the smell of GAIN!!!!!!!!!!!!!!!!********
* LOVE YA,*
* BIRTHA *
P.S.*LOL*
BIRTHA WORTH THE 7TH, November 17, 2006 11:47 AM
IF YOU STILL LIVE THERE MOOOOOOOOOOOOOOOOVE OUT! IF YOU ARE ALIVE MOOOOOOOOOOOOOOVE OUT! THE GHOST MIGHT KILLLLLLLLLLLLLLL YOU ONE DAY! YOUR VOLINTER, LUPITA PS.MOOOVE OUT :(!
PATRICK, April 8, 2009 4:42 PM
funny
Anonymous, April 11, 2009 8:14 PM
that is amazing
Anonymous, April 17, 2009 11:44 PM
that scares the ghost right out of me!!!!!!
jj, April 17, 2009 11:47 PM
hi peoples
Anonymous, April 17, 2009 11:48 PM
hi you gools and ghost
Anonymous, April 17, 2009 11:48 PM
i mean ghouls
Anonymous, April 17, 2009 11:49 PM
thats true cause i can see ghoast im not trying to scare you but thers one that is in front of the other side of the road that every 12;00 you can hear the drums & the guns,canos going off. well im glad sharing with you but I haft to go bye.
star, April 20, 2009 6:21 PM
i thought it was a good story and i totaly belive in ghost no mater wat great storie2 thanx
curly, June 19, 2009 10:26 PM
i love those picturs i've seen them befor
cookie, June 22, 2009 11:42 AM
this is werid
selena murray, July 2, 2009 2:44 PM
Post a comment