Oh, I got hot sause all over my bazito!

You know what this is? It's a brain sucker. You know what it's doing? Filing its tax return

If you wish to make an apple pie from scratch, you must first invent apple pie

The Adventures of Little Ed Brave

Tell airport security your name is McCannister because you can hide anything in a cannister.

You know what? Nobody notices when this changes anyway.

There are 10 types of people in the world: Those who understand binary, and STFU

What happens in a black hole stays in a black hole

The black hole draws you inexorably inward. Time slows. You are likely to be eaten by a grue.

I'd diddle little umdidlie... if she weren't my half-sister.

Abortion prevents pedophilia. In more ways than one!
Get Firefox!
I wrote a haiku

which I was about to share,

but then I thought, "screw it."
Level 1

Notice to all users of the Holodeck:

There are safety protocols in place that cannot be deactivated without the approval of two commanding officers or the captain to protect users of the Holodeck from potential harm. However, every time the Holodeck is ever used in a nontrivial manner, no matter what the safety protocols say, the Holodeck turns into a deathtrap.

Unless you believe yourself to be adept at constructing a forcefield from your communicator and 19th century Earth tools, or you're at the very least not wearing a red shirt, you are strongly advised not to attempt to use the Holodeck until a designer comes up with a safety protocol that doesn't kill you whenever somebody looks at it funny. Even when you're not on the holodeck. Or in the same quadrant. Or time period.

In fact, if you are wearing a red shirt, Starfleet may not be the job for you

« Only 6, 8, and 12, pleaseA single clue »

Hand-To-Forehead moment

Permalink 09/17/08 at 08:07:04 am, by Ed, 196 words   English (US)
Categories: Programming

I was having a heck of a time figuring out why my program wasn't working correctly. It's basically a go-between server designed to allow certain client computers that can only communicate one-way (to the server) to still act like it's receiving messages from the server as well.

Each client gets its own SessionUser object on the server that has two threads running on it. If there are no messages from the client for an extended period of time, the server times out and disconnects the client.

It achieves this by setting a single value, bQuit, to true, which the threads listen for and exit when they find it to be true. I was having a heck of a time figuring out why my system stops working after awhile. Were there too many threads? Why was my system randomly not scheduling these threads to run at all?

But then I found out that I had set bQuit to be static. That meant that any time a SessionUser changes bQuit, ALL of the SessionUser objects quit, not just the one that set it. I just feel silly now. It's a "find hand, apply directly to the forehead" moment.

No feedback yet

Comments are closed for this post.