Monday, March 08, 2004

The Only Card I Need Is The Ace Of Spades

I'm a hell of a C programmer. I'm crazy. Here's the thing: gzochi launches a lot of threads. Creeps, think of threads as a bunch of concurrently executing blocks of code -- you've got to run things in threads if you want your program to act like it's thinking about more than one thing at once, like say, printing messages and listening to the keyboard at the same time. gzochi, for instance, has a thread that listens for new connections and other threads that talk to existing connections. The problem is that sometimes one thread needs to stop the execution of all the other threads in a coordinated way, for example, when you want to shut down the gzochi server and have the game threads politely hang up on the clients and save all the information about currently executing games to the database. This is a tough problem because there's no built-in way for one thread to kill a thread it didn't launch -- most of the time, each thread has no idea that other threads even exist. Well, try this on for size: I've written a wrapper function for the thread creation call that records an identifier for the thread object in a "registry," launches the thread, "joins" (i.e., waits) on its exit, and then removes it from the registry. If, between the time the thread gets launched and the time it exits, the shutdown function runs, it goes through the thread registry cancelling all the threads, which in turn causes each thread's cancellation handler, which does useful things like saving user data and closing connections.

SICK.

I bought a ticket for the April 4th Distillers show at the Bowery Ballroom. Picture me nuzzling Brody Dalle's massive bicep.

If you listen to Howard Stern (who, by the way, deserves a Pulitzer for doing an hour long bit about constitutional speech and the fallacy of decency and then putting a guy on the air who needs women to vomit on him in order to get off and having some willing listener come in and vomit on him; someone called in and said he'd had to run out to his front porch to puke, he'd been so disgusted, and saw people pulling over in their cars to puke out the windows) in the morning like I've been doing for the past week or so, you'd think there's going to be some kind of cultural apocalypse in this country in the next decade or so. I'd been reluctant to agree about that sort of thing, but it's looking more and more likely. Creepy, huh? It's not like I'm as attached to this country as all you simpering immigrants out there, I just don't quite know where to go when it happens. Japan? Scandinavia? Okay, but let's say that all the people that generate capital for this country were to up and leave and go somewhere else -- it's not an entirely unreasonable proposition; these guys who work at Goldman Sachs and what have you are real sick puppies, thoroughly corrupt and selfish, but the majority of them are atheists, I think. Then the only people left would be the religious trash, who, in the face of an economic meltdown, would whip themselves into a frenzy over all those Islamiacs, say, and then start firing missiles and invading Middle Eastern countries. That would be great -- nothing makes me happier than people who believe in an afterlife slaughtering each other on the altar of self-righteousness. I'm serious; I'm sorry if that creeps you out, but I get totally gleeful over the idea of a bunch of mangled theist bodies.

Speaking of Howard Stern, a friend of a friend of Mer's is staying over at our place. Apparently she's interviewing with a bunch of companies in New York and doesn't know anybody who lives here. If that doesn't make her sound a bit suspect, she's "interested in media management." For fuck's sake, that sounds like this Epsilon semi-moron Nari who I took Princeton Review with. She wanted to go to University of Miami where she could "study the music industry, which is like no other industry on Earth." Where do these people get these ideas? Is there a big machine somewhere that cranks out slightly-below-average-intelligence babies in black pants suits with congenitally attached textbooks on Marketing and no ambitions? Anyway, this girl mentioned that she'd interned at Clear Channel her sophomore year, which made me mad until I told myself that it's kind of like interning at Microsoft, which is something I tried to do once -- unsuccessfully, I might add. Is it? Who knows.

Links and stinks:

No comments: