Pipelining your laundry, and the ensuing silliness

One of my colleagues told us that her seven-year-old niece discovered the concept of pipelining while contemplating how her grandmother could have laundry in both the washing machine and dryer simultaneously.

Since we are nerds, we naturally tried to extend the metaphor to other features of modern CPU design. I pointed out that grandma probably had a quad-core stovetop. And if grandma started washing your favorite blanket when she heard you were coming (before you asked for it), that would be speculative execution. Or it could just be "because your grandma loves you."

(Restaurants often engage in speculative execution when they see a regular who always orders the same thing.)

Another colleague challenged me to come up with an example of a laundry pipeline hazard. I sort of came up with the case of a two-piece outfit which is washed separately, but must be dried together for blocking purposes.

Of course, all this nerdiness was too much for some people. A colleague remarked, "Note to self: Keep my daughter away from these people."

Comments (33)
  1. Mason Wheeler says:

    > “Note to self: Keep my daughter away from these people.”

    Interesting to see this posted on Valentine’s Day…

  2. parkrrrr says:

    A friend of mine has one washing machine and two dryers, for the purpose of improving throughput. She observed that her washing machine took approximately half as long to do its job as her dryer, and there was plenty of space in her laundry room, so she bought a second dryer.

    1. Robert Sharp says:

      I’ve considered the opposite: Two washers and one dryer. The dryer can dry two loads from the wash simultaneously.

      In our house, often two loads is all that’s ready.

    2. Brian_EE says:

      It’s not one of those newer high-efficiency washing machines then. On the newer machines the wash and dry cycles are about equal if the same type of clothing is in each.

      1. morlamweb says:

        @Brian_EE: that’s not a given. On my washer, the wash cycle can be anywhere from 31 to 64 minutes, just by adjusting the “how dirty are these clothes?” setting (and that’s on the eco cold setting, which doesn’t use any hot water). Drying times are similarly adjustable, particularly if it has a cold water inlet for steam settings.

      2. user says:

        In my house the (high efficiency) washer can take up to 2x as long as the dryer for the same load. But it’s kind of moot anyway since both machines are idle 95+% of the time, there’s no need to streamline it.

  3. Karellen says:

    If your colleague is audibly remarking “Note to self”, her desire to protect her daughter from “these people” is likely to be futile, as it appears that she herself is also one of “these people”.

    Also, that subset of your clothes which you wear most often, and end up in the top/at the front of your clothes storage to be worn again and again, would be your “working set”, or possibly your “L(aundry)1 cache”. People with a larger cache can get away with doing laundry less often (although I may have mixed up cause and effect here ;-) Retrieving other clothes not in that set takes more time. The ones that you’ve vacuum-packed and put in the attic have been “swapped out”.

    1. “L(aundry)1 cache” is brilliant.

    2. Brian says:

      I actually work hard to keep my commodity laundry (like underwear and socks) in a queue. When I cart the laundry upstairs, I load the sock drawer on the left. In the mornings, I pull my socks from the right. That way, everything wears out at about the same rate.

      1. user says:

        Wear leveling for your SSD (Shorts and Socks Drawer)? That’s smart.

        1. Josh says:

          This was the point when I had to bite my own lip to keep from literally bursting into laughter in the middle of a meeting.

  4. Mike Caron says:

    > quad-core stovetop

    That is a brilliant analogy for modern CPUs.

    “There used to only be single core CPUs – imagine a stove with just a single hot plate. Some people got the idea that they could put a second – or more – CPUs in their computer. But, much like buying a second stove, it was big and inefficient. Then, the CPU makers had the idea to put multiple cores (hot plates) in the same chip (stove) which is much more efficient. Servers, aka industrial kitchens, might still have multiple physical CPUs, but all normal end-user machines will only have one, with varying numbers of cores.”

    1. It also explains why upgrading your stove to quad-core doesn’t make your risotto cook any faster.

      1. Gwen says:

        Electrical stoves often have ‘Turbo Boost’ though.
        The total power is often limited by typical household standards, which means you can cook risotto faster on any one of the 4 plates, but can’t use 4 at that power at the same time.

        1. Kakurady says:

          Just like CPUs, which sometimes need to throttle its frequency to not exceed TDP, or boost it when more heat budget is available.

        2. morlamweb says:

          @Gwen: that’s interesting, I haven’t heard of that feature in electric ranges. Electric elements operate by supplying a set amount of amps at 240 volts to the heating element. The temperature control doesn’t vary the volts or the amps supplied to the burner, but rather, the ratio of time that the burner is on vs. off. “Hi” setting is 100% on, 0% off. A “fast cook” setting on an electric rangetop suggests that there’s some “Hi +” setting. Since at Hi the burner is already on at 100% of the time, this mode suggests that it changes one of the variables; perhaps it boosts the amperage to that burner? If so, I hope that the elements are made to handle the extra amperage.

          1. Les Bartel says:

            That would be pulse width modulation.

      2. smf says:

        >It also explains why upgrading your stove to quad-core doesn’t make your risotto cook any faster.

        Splitting the risotto into four would make it cook faster, but the saving would probably be wiped out by the extra stirring and washing up. The pentium 4 suffered a similar problem.

  5. arezz says:

    Coincidentally, doing the laundry in a shared flat was used as an example for pipelining in our university courses…

  6. Kakurady says:

    Re: laundry pipeline hazard: I tend to often have clothes than can be washed properly, but must be dried separately; cotton/polyester, for example.

  7. Alessio T says:

    Isn’t the laundry pipeline the same metaphor used in the Patterson-Hennessy books?

    1. Viila says:

      It is. My copy of Computer Organization & Design has a four stage laundry pipeline: 1. washing, 2. drying, 3. folding, 4. putting away

  8. My, my! You should be on The Big Bang Theory.

  9. Yukkuri says:

    Patterson and Hennessy use this analogy in the Computer Organization and Design textbook…

  10. cheong00 says:

    “Pipeline hazard” occurs when the washing machine and dryer both finish their job roughly at the same time. You only have one person to unload the clothes from the machines. :P

  11. Scarlet Manuka says:

    Oh, here’s one for branch prediction: When I have to make a separate meal for one of my kids who is a fussy eater, and I get out the stuff for something I think they’ll go for while I’m asking them if they want it. Saves time if I’m right, if I’m wrong I have to go and put it back.

  12. jgh says:

    I wash my mug /after/ filling and turning the kettle on.

    Hmmm… time for a cuppa.

  13. Ivan K says:

    On occasion I will use the local laundromat to increase bandwidth if I have a bunch of bedding and laundry. It isn’t relatable to pipelining laundry unfortunately because everything laundry related stalls during the wash process. But one other thing I have learned about is Goon of Gortune off a Hills Hoist. https://en.m.wikipedia.org/wiki/Goon_of_Fortune

    1. Ivan K says:

      *fortune hah.

  14. Jonathan says:

    Hmm, is it a pipeline stall when the drier is tied up extra long with a heavy blanket? I’m not sure if there’s a proper term for a computer instruction that may sometimes take additional clock cycles and prevent data from moving through the pipeline.

  15. regdul says:

    And if you dry your laundry on a clothesline, it’s an example for memory fragmentation. At the start, the clothesline is empty. When I want to malloc() 20 pieces of laundry there is a nice contiguous chunk available.

    Then my roommate adds his laundry after mine, and I take mine down. Now the start of the line is free, but the second third is occupied. If someone now needs a large piece of clothesline (say they are washing their bedsheets and their clothes), the request can only be fulfilled by a fragmented set of clothesline, since the middle is occupied and the free areas are too small.

    At my flat, this goes to the point where I had only six small holes of unallocated clothesline, greatly reducing access speed.

    Sadly, my roommates did not enjoy me asking them to use a fragmentation-minimizing allocation algorithm :(

    1. Ivan K says:

      Not sure. At any rate, deploying a goon of fortune would be memory fragmentation agnostic at best, for the participants. And would be totally untidy at a laundromat.

Comments are closed.

Skip to main content