Brandon's Blog

6/29/2006

W-W-W-W-What?

Good day at work.  Getting stuff done and a very good meeting with the mentor.

But, this is somewhat shadowed by a revelation […]

I have to take a little existential break here, because what I had been typing, then deleting, before this current paragraph was completely ridiculous.  I was attempting to mock the writing style and some of the content of Frank Herbert’s Dune in a dramatic adaptation of my thought processes regarding the following subject matter.  Needless to say, I must be a complete lunatic today.  Let’s leave it at that.

So, I have been going around in circles today about mail systems.  It’s been my little gedanken experiment for the day.  I climbed onto the bus and a Herbert-ian italicized thought came into my head (hence the little misplaced Coda of this work):

But what is the ideal mail system?

I figured I couldn’t make a good one if I wasn’t sure what the best one would be.  And, honestly, I had no clue what it would be when I started the morning today.

Many of my thoughts have circled around the organization of a virtual mail storage system (meaning, one that does not utilize system accounts and logins for each user).  These always look great in a whitepaper until you realize that things like mail filtering really, really, really suck when you can’t switch to a unique system user account to perform the tasks.  Plus, you have this constant, grinding problem of keeping all 3-5 programs in the daisy chain looking at the same list of users.

The closest thought I have ever produced with regard to a “perfect” system was a “what if” (a good gedanken start) question that had always been put away with a complacent, “Yeah, right.  No way.”  The question, O me, so sad, recurring, “If Dovecot only had an LDA (Local Delivery Agent, puts mail from the SMTP server’s queue into a user’s mail folder) that understood its own file structure, wouldn’t this be gravy?”

Of course (well, maybe not so obviously), the answer is a resounding “Yes, if it only existed.”  Because, basically, you’ve lowered your “Number of Applications Needing to be Smart About Users” metric down one or two by keeping mail routing contained within a large, smart, essential software package like your POP/IMAP service.

Here’s the revelation: Dovecot has an LDA.  Yes, I know I should have RTFM a little better.  This sucker even has a filtering language (i.e., means of performing a spam check)!

This merits a trial run.  We’re talking simple here, like two programs plus the filter.  Major deal.

Well, I’m back on the clock.

6/27/2006

Revolving Experience

I think about this time last year, I wrote a blog entry about tea that tasted like lawn clippings.

Well, here I am again, sitting at a desk sipping tea that tastes like peppermint-flavored lawn clippings.  At least there is marginal improvement!

6/25/2006

Whew

Church today had a buzz to it that hadn’t been there for some time.  It’s pretty clear the new guy has “the juice.”  I’m reminded of an old favorite:

He who was seated on the throne said, “I am making everything new!” (Rev. 21:5)

and, perhaps, a bit more didactically:

Here is a trustworthy saying: If anyone sets his heart on being an overseer, he desires a noble task. Now the overseer must be above reproach, the husband of but one wife, temperate, self-controlled, respectable, hospitable, able to teach, not given to drunkenness, not violent but gentle, not quarrelsome, not a lover of money. He must manage his own family well and see that his children obey him with proper respect. (If anyone does not know how to manage his own family, how can he take care of God’s church?) He must not be a recent convert, or he may become conceited and fall under the same judgment as the devil. He must also have a good reputation with outsiders, so that he will not fall into disgrace and into the devil’s trap. (1 Tim. 3:1-7)

The intent of my emphasis is left as an exercise to the reader, if they are so informed.

6/25/2006

I Concur, Dave

I concur.

6/25/2006

Carlos?

Apparently, to an inebriated woman on Saturday night, our phone number looks amazingly like that of a Latin Adonis named Carlos.  Knowing that her amor-agram had reached the wrong destination was insufficient for her effusive interest; she had to know who she had reached.  Her passion was limitless.

I reassured her: “I’m not Carlos.”  She was taken aback with my supercilious manner.  It didn’t matter that it was 11:45.  Carlos must be reached!

Back to Python…

6/24/2006

Thar She Blows

If someone is up, desparately trying to discover what I’ve been thinking about Python lately, things may look weird for the next few minutes.  We’re doing something about this design thing.

6/23/2006

Dapper

Ubuntu Dapper is the best I’ve seen, especially with some of the less-legit or less-GPL extensions tacked on.  It’s really good.

Yellowcard sucks, by the way.  If you asked me yesterday what they sing, I couldn’t tell you; I still can’t today, but I’ve now seen them on Letterman.

Ubuntu just recognized a music CD (inspired by Yellowcard’s suckage) automatically and asked me if I want to (always) launch a CD player.  We’re close here, folks.

I guess I don’t have too much for the old page tonight, except that I am absolutely sick of the funhouse blue currently used in this page’s background.  If I can scrape some time together, I might do a re-design soon.  It’s like a beach ball or something.  I can deal with the curly braces, but I’m doing Python now, so it’s hardly appropriate.

Work is going pretty well now.  Black Hawk Down (the literary variant) isn’t quite what I thought it would be, but I’m sticking with it.

Well, my little fourteenth wind here is dying out, and it’s going to be SAP Queries of the Living Dead tomorrow if I don’t cut if off right here.

6/22/2006

Ich Ben Ein...

First Dirk fails me, then SAP takes a dump on my lap.

What ails thee, Germania?

6/21/2006

Update

I’m running SAP queries that take over 10 minutes apiece to resolve.  So, in the meantime, I’ve elected to not use threading, as the GIL (“Global Interpreter Lock”) in Python apparently limits the system to one thread at a time.

So, no multiprocessor/dual-core sexiness for Python.

6/21/2006

Lunch Break

Much more lively day at work today, but there’s always time for some musing.

I’m thinking of moving my socket-reading routine (based on the standard select() call) over to its own thread.  This is a big step for me, as I have absolutely no clue what I’m talking about when it comes to threads.

But the thinking is this: we basically hand over control of the socket list (dictionary) to the socket selecting thread, with a strong, “no touchy” commandment to the big, bad handler thread, since the dictionary isn’t thread-safe.  It polls, or (more accurately) selects, these descriptors looking for germane read/write events (like stating files).  It then just has to pass any input along to the handler through some thread-safe route.

This is Python, so it has to be easy.  My inter-thread communication (yes, I’m sure there’s a better phrase) will be the built-in Queue object, which is a thread-safe… queue.  I add in a little Yes/No boolean flag called something like “signal” so that the socket reader can pass special information (like that the stupid Player needs to be shut down and saved immediately because he cut the cord before typing “quit”).

We’ll have to have a very small, second Queue for messages to the socket reader, since smart Players will pass “quit” messages to end their sessions.  This command, of course, would be routed from the socket thread to the handler thread.  The handler thread would save and kill off the Player (”${name} has left the game.” sent to all in-room peers, etc.).  But, the socket has to be shut down during an orderly exit, and we can’t jump over the thread’s wall without a race condition (I’m so out of my league here).  So, the handler queues a “shutdown” notice for the socket thread to pick up and deal with at its convenience.

Unfortunately, my little pseudo-daemon intermittent “task” routines (for things like denizen repopulation, server status outputs, and weather effects) cannot be run in their own thread, as they will, at times, be interacting with the same data the big boy is dealing with at every moment.  And locks on linked-lists of data (Rooms, Players, Denizens, combat, …) doing anything but slowing things down seems quite unlikely.

So, I think that would work.  If sockets weren’t so alien to the rest of the program, I don’t think it would work.  But, the little thread-safe Queue library seems to eliminate the complexity of locking.

> Newer Posts

< Older Posts