Archive

Archive for August, 2009

Wanted: a portable mutex and atomic refcount

August 14th, 2009 Josh 1 comment

upb needs to have some lightweight thread-aware behavior. I’m leaving most synchronization up to users (individual messages will not be thread-safe), but there are a few central structures I need to make thread-safe and reference-counted.

I need only the tiniest bit of functionality:

  • a portable mutex.
  • a portable atomic_t that lets me atomic_inc() and atomic_dec().

We’re talking “lives in one single header” small. The mutex would just be wrappers around existing mutex implementations (pthreads, windows, etc), and since those routines typically take care of any memory barriers you need to safely read/mutate the shared state, I wouldn’t have to worry about that.

The atomic type would have to be hand-coded and architecture-specific, since most threading libraries don’t provide one. The reason for providing this would be reference-counting. If you are reference-counting an immutable structure, then you don’t need to worry about memory barriers to ensure the consistency of that structure; if you’re reference-counting a mutable structure, then you’ll need to protect the mutable state with mutexes and acquire the mutex before freeing anything.

The library (er, header file) should also support compiling everything to nothing if NO_THREAD_SAFETY is defined as a preprocessor symbol.

Yes, that all sounds good. Tiny yet functional. I’ll be writing this very soon unless something exactly like what I’ve described happens to already exist.

Categories: Uncategorized Tags:

Wanted: a mailing list reader website

August 10th, 2009 Josh No comments

There is tons of interesting discussion that happens on technical mailing lists. Mailing lists are the best snapshot of the state of a software project; they capture what current users are trying to do, where they’re succeeding, where they’re running into trouble, and what the current plans are for making things better.

Unfortunately, there is still no good way (AFICS) to lurk on high-volume mailing lists. Your current options are:

  • Subscribe your personal email address to the mailing list. Pros: threads well, tracks “read” status well, easy to reply. Cons: too much overhead to subscribe to a new list (subscribe, confirm, set up mail filter), mail builds up as unread if you don’t read it for a while. Overwhelming for high volume lists. Not convenient when your level of interest in a list varies.
  • Read on gmane.org. Pros: threads somewhat well (new messages on old threads get lost, because the whole thread is sorted based on when its first message arrived), tracks your “read” status (but not across browsers or computers), easy to track a single list and only read what interests you. Cons: not easy to track multiple lists. There’s no top-level “what’s new on lists I care about” view. Not easy to reply (the built in editor makes you wrap lines yourself).
  • RSS feed from gmane.org. Pros: easy to track multiple lists, old mail doesn’t build up if I don’t read it for a while, lets me read mailing list posts alongside my other feeds. Cons: RSS is a terrible match for mailing lists. It doesn’t understand threads at all. No easy way to reply. Also, the gmane RSS feeds link you to the blog interface, which is equally terrible at threading.
  • The Lurker email archiver. I’ve been a fan of this project for a while. Pros: GREAT interface (check out this demo site), top-level page that summarizes threads and their activity, thread view that shows you replies according to both time and threading. Cons: you have to run it yourself (it’s a project, not a service), doesn’t remember what you’ve read, and no easy way to reply.

What I would love is a website that would let me easily lurk on mailing lists. I’d love an interface like Lurker, but that I log into so that it knows what I’ve read. I’d want a top-level view that shows popular threads across ALL mailing lists I’m lurking on, not just one mailing list at a time. And I’d want the ability to easily reply to mailing list threads.

If anyone knows a better way to get what I want, please let me know!

Categories: Uncategorized Tags: