This Is Bad

You know you’ve been spending way too much time programming when you suddenly see the people making sandwiches at the deli counter as a thread pool, and the single slicer as a synchronization object.

8 Comments

  1. MikeZ says

    It’s worse than bad; the slicer might be a resource protected by a synchronization object, but it is not one itself.

    But we get the idea; sounds like you need a vacation. :-)

    – M

    Posted November 23, 2009 at 3:52 pm | Permalink
  2. Malcolm says

    Well, I thought about this before posting: the slicer is actually both synchronization object and resource, as only one person can acquire/use it at a time. But I didn’t want to overburden the readers…

    You could even say the slicer is the synchronization object that must be acquired in order to use the resource, which is the spinning blade, which might in turn be thought of a parser that takes as its input a slab of meat that it renders as thin slices… aaarrrggghhh…

    Just shoot me now.

    Posted November 23, 2009 at 4:13 pm | Permalink
  3. MikeZ says

    I think that unless fist fights amongst potential owners are a frequent occurrence at the deli (maybe I should visit the deli in question), I contend there is something else at work performing the role of the synchronization object (like the demand for civility in the thread pool by the deli owner). I think confusing ownership with a convention used to acquire ownership might be the problem, which I think stands out as something distinct in instances of high contention. In the software world, I don’t think I would derive a slicer from mutex. Would you? I have missed the point of how to apply mutex in the OO world?

    – M

    Posted November 23, 2009 at 4:55 pm | Permalink
  4. MikeZ says

    Hey! You snuck in an additional paragraph while I was working on my follow up. You may need more than a vacation. :-) A vacation with liberal amounts of gin, for example.

    – M

    Posted November 23, 2009 at 4:59 pm | Permalink
  5. Malcolm says

    Yeah, uploading to the server is just the beginning of editing a post or a comment.

    You make a fair point. The real synchronization object doesn’t exist in the deli at all; it is simply that the waiting threads observe the resource, and pause civilly while somebody’s got the slicer.

    Gin, please.

    Posted November 23, 2009 at 5:05 pm | Permalink
  6. MikeZ says

    See… I can do more than “Yikes!” :-) You just have to give me the right topics to get me motivated.

    – M

    Posted November 23, 2009 at 5:11 pm | Permalink
  7. MikeZ says

    In hindsight I probably should have started with ‘Yikes! It’s worse than bad!”

    – M

    Posted November 23, 2009 at 5:14 pm | Permalink
  8. Charles says

    It’s been a long time since I’ve done that much programming to have delusions like that. I do remember, though, after a particularly long bout of Photoshop, putting on my sunglasses and thinking of them as my own personal gamma correction device.

    Posted November 23, 2009 at 9:35 pm | Permalink

Post a Comment

Your email is never shared. Required fields are marked *

*
*