QOTW

Discussion in 'NZ Computing' started by Lawrence D'Oliveiro, Oct 5, 2010.

  1. “Whenever faced with a problem, some people say `Lets use multithreading.'
    two they problems. Now, have.â€

    (Found on Twitter. Ahem.)
    Lawrence D'Oliveiro, Oct 5, 2010
    #1
    1. Advertising

  2. Lawrence D'Oliveiro

    Matty F Guest

    Lawrence D'Oliveiro wrote:
    > “Whenever faced with a problem, some people say `Lets use multithreading.'
    > two they problems. Now, have.”
    >
    > (Found on Twitter. Ahem.)


    I know of a nationwide hotel booking system that was specially
    programmed to work on a machine using multithreading. Task switching
    was a lengthy affair. Each hotel had to be locked in case another
    thread took the last rooms left, then unlocked again later. Booking a
    tour in many hotels around NZ took so long that the system timed out
    after a few minutes.
    The system was rewritten for another machine using single threading. A
    maximum sized tour took about one second, since the one thread had the
    whole machine's resources available and didn't need to lock anything.
    Matty F, Oct 6, 2010
    #2
    1. Advertising

  3. Lawrence D'Oliveiro

    Sweetpea Guest

    On Thu, 07 Oct 2010 10:26:58 +1300, Allistar wrote:

    > Either this was a long time ago (running on inefficient hardware) or was
    > developed very poorly.


    I wouldn't mind seeing the name of that application.

    Is the current version still available?


    --
    "Filtering the Internet is like trying to boil the ocean"
    Sweetpea, Oct 7, 2010
    #3
  4. In message
    <>, Matty F
    wrote:

    > The system was rewritten for another machine using single threading. A
    > maximum sized tour took about one second, since the one thread had the
    > whole machine's resources available and didn't need to lock anything.


    All together now: “Premature optimization is the root of all evilâ€.

    Threading is a performance hack. Like all such hacks, it’s not something you
    put in unless you can show that it actually improves performance. Otherwise,
    it just complicates your code to no end.
    Lawrence D'Oliveiro, Oct 7, 2010
    #4
  5. Lawrence D'Oliveiro

    Enkidu Guest

    On 07/10/10 10:26, Allistar wrote:
    > Matty F wrote:
    >
    >> Lawrence D'Oliveiro wrote:
    >>> “Whenever faced with a problem, some people say `Lets use
    >>> multithreading.' two they problems. Now, have.â€
    >>>
    >>> (Found on Twitter. Ahem.)

    >>
    >> I know of a nationwide hotel booking system that was specially
    >> programmed to work on a machine using multithreading. Task switching
    >> was a lengthy affair. Each hotel had to be locked in case another
    >> thread took the last rooms left, then unlocked again later. Booking a
    >> tour in many hotels around NZ took so long that the system timed out
    >> after a few minutes.
    >> The system was rewritten for another machine using single threading. A
    >> maximum sized tour took about one second, since the one thread had the
    >> whole machine's resources available and didn't need to lock anything.

    >
    > Either this was a long time ago (running on inefficient hardware) or was
    > developed very poorly.
    >

    Well, the threading libraries were new then, and have improved
    enormously, and some early applications that were 'advertised' as
    multi-threading actually just spawned task after task, after task.

    Cheers,

    Cliff

    --

    The ends justifies the means - Niccolò di Bernardo dei Machiavelli.

    The end excuses any evil - Sophocles
    Enkidu, Oct 7, 2010
    #5
  6. In message <>, Allistar wrote:

    > Threading is a performance hack? That's like saying "caching is a
    > performance hack".


    Out of the mouths of babes...

    > A well designed application that needs threading would have it built in
    > from the ground up. Not forced in as an after thought.


    Premature optimization is the root of all evil.
    Lawrence D'Oliveiro, Oct 8, 2010
    #6
  7. In message <>, Allistar wrote:

    > Lawrence D'Oliveiro wrote:
    >
    >> Premature optimization is the root of all evil.

    >
    > On that we disagree.


    Then you know nothing of computing.

    <http://www.google.com/search?q=premature+optimization+is+the+root+of+all+evil>
    Lawrence D'Oliveiro, Oct 8, 2010
    #7
  8. In message <>, Allistar wrote:

    > Lawrence D'Oliveiro wrote:
    >
    >> In message <>, Allistar
    >> wrote:
    >>
    >>> Lawrence D'Oliveiro wrote:
    >>>
    >>>> Premature optimization is the root of all evil.
    >>>
    >>> On that we disagree.

    >>
    >> Then you know nothing of computing.
    >>
    >>

    > <http://www.google.com/search?q=premature+optimization+is+the+root+of+all+evil>
    >
    > I know nothing about computing because I disagree with a quote that one
    > particular person has said?


    Go do some reading, You might learn something.
    Lawrence D'Oliveiro, Oct 8, 2010
    #8
  9. Lawrence D'Oliveiro

    Enkidu Guest

    On 08/10/10 15:01, Lawrence D'Oliveiro wrote:
    > In message<>, Allistar wrote:
    >
    >> Lawrence D'Oliveiro wrote:
    >>
    >>> Premature optimization is the root of all evil.

    >>
    >> On that we disagree.

    >
    > Then you know nothing of computing.
    >

    Hehehehehehehehehe! This from the guy who still thinks software RAID is
    a good idea! Hehehehehehehe!

    Cheers,

    Cliff

    --

    The ends justifies the means - Niccolò di Bernardo dei Machiavelli.

    The end excuses any evil - Sophocles
    Enkidu, Oct 8, 2010
    #9
  10. Lawrence D'Oliveiro

    Enkidu Guest

    On 08/10/10 15:12, Allistar wrote:
    > Lawrence D'Oliveiro wrote:
    >
    >> In message<>, Allistar
    >> wrote:
    >>
    >>> Lawrence D'Oliveiro wrote:
    >>>
    >>>> Premature optimization is the root of all evil.
    >>>
    >>> On that we disagree.

    >>
    >> Then you know nothing of computing.
    >>
    >>

    > <http://www.google.com/search?q=premature+optimization+is+the+root+of+all+evil>
    >
    > I know nothing about computing because I disagree with a quote that one
    > particular person has said?
    >
    > I have been involved in many systems where efficiency and optimisation was
    > ignored and I have seen the consequences of that. It often result is major
    > rearchitecturing which is both costly and disruptive.
    >
    > While I agree that the architecture of a system shouldn't be driven entirely
    > by performance considerations, I do think such considerations are quite
    > important to the end result. There's no point having a very elegantly
    > designed solution if it performs like crap and annoys users.
    >

    Exactly.

    Cheers,

    Cliff

    --

    The ends justifies the means - Niccolò di Bernardo dei Machiavelli.

    The end excuses any evil - Sophocles
    Enkidu, Oct 8, 2010
    #10
  11. Lawrence D'Oliveiro

    Enkidu Guest

    On 08/10/10 16:50, Lawrence D'Oliveiro wrote:
    > In message<>, Allistar
    > wrote:
    >
    >> Lawrence D'Oliveiro wrote:
    >>
    >>> In message<>,
    >>> Allistar wrote:
    >>>
    >>>> Lawrence D'Oliveiro wrote:
    >>>>
    >>>>> Premature optimization is the root of all evil.
    >>>>
    >>>> On that we disagree.
    >>>
    >>> Then you know nothing of computing.
    >>>
    >>>

    >> <http://www.google.com/search?q=premature+optimization+is+the+root+of+all+evil>
    >>
    >>
    >>

    I know nothing about computing because I disagree with a quote that one
    >> particular person has said?

    >
    > Go do some reading, You might learn something.
    >

    Ignore the dimwit Allistar. He's not worth the expenditure of even
    minimal energy.

    Cheers,

    Cliff

    --

    The ends justifies the means - Niccolò di Bernardo dei Machiavelli.

    The end excuses any evil - Sophocles
    Enkidu, Oct 8, 2010
    #11
  12. Lawrence D'Oliveiro

    Matty F Guest

    On Oct 7, 10:26 am, Allistar <> wrote:
    > Matty F wrote:
    > > Lawrence D'Oliveiro wrote:
    > >> “Whenever faced with a problem, some people say `Lets use
    > >> multithreading.' two they problems. Now, have.”

    >
    > >> (Found on Twitter. Ahem.)

    >
    > > I know of a nationwide hotel booking system that was specially
    > > programmed to work on a machine using multithreading. Task switching
    > > was a lengthy affair. Each hotel had to be locked in case another
    > > thread took the last rooms left, then unlocked again later. Booking a
    > > tour in many hotels around NZ took so long that the system timed out
    > > after a few minutes.
    > > The system was rewritten for another machine using single threading. A
    > > maximum sized tour took about one second, since the one thread had the
    > > whole machine's resources available and didn't need to lock anything.

    >
    > Either this was a long time ago (running on inefficient hardware) or was
    > developed very poorly.


    It was written about 1980. The inefficient machine was a Data General
    I think.

    I did post this reply some days ago but posting from Google has not
    worked for a few days.
    Matty F, Oct 9, 2010
    #12
  13. Lawrence D'Oliveiro

    John Little Guest

    Lawrence D'Oliveiro wrote:

    (Just found a bounce for this in my spam.)

    >Premature optimization is the root of all evil.


    I've never liked that:
    - There are computing evils that cannot be even remotely related to
    premature optimization.
    - It's used to excuse pessimization, premature or otherwise.
    - It's not practical to take "doing things efficiently" out of "doing
    things right".

    > Threading is a performance hack.


    Not always. It can be a way to cope with operations that block,
    especially inhomogeneous ones.

    Regards, John
    John Little, Oct 10, 2010
    #13
  14. In message
    <>, John
    Little wrote:

    > - It's used to excuse pessimization, premature or otherwise.


    Agreed, that’s a misuse.

    > - It's not practical to take "doing things efficiently" out of "doing
    > things right".


    Doing things right must come first.

    >> Threading is a performance hack.

    >
    > Not always. It can be a way to cope with operations that block,
    > especially inhomogeneous ones.


    The usual *nix way of dealing with those is forking, not threading.
    Lawrence D'Oliveiro, Oct 11, 2010
    #14
  15. Lawrence D'Oliveiro

    John Little Guest

    On Oct 11, 2:23 pm, Lawrence D'Oliveiro <l...@geek-
    central.gen.new_zealand> wrote:

    > > - It's not practical to take "doing things efficiently" out of "doing
    > > things right".

    >
    > Doing things right must come first.


    But my point still stands.

    > >> Threading is a performance hack.

    >
    > > Not always.  It can be a way to cope with operations that block,
    > > especially inhomogeneous ones.

    >
    > The usual *nix way of dealing with those is forking, not threading.


    For windows the usual way(I'm told) is threading, forking not
    performing well, and I'd argue that this led to instability of much
    windows software.
    For *nix, I agree, but for some applications the need for sharing data
    leads to shared memory, mutexes, potential for race conditions, and so
    on, and you've got most of the downside of threading. You're still
    redesigning stuff for performance. Another alternative to threading
    (that I've resolved to favour) to cope with operations that block,
    especially homogeneous ones, is multiplexing; again, with subtleties
    and redesign for performance.

    Regards, John
    John Little, Oct 11, 2010
    #15
  16. In message
    <>, John
    Little wrote:

    > On Oct 11, 2:23 pm, Lawrence D'Oliveiro <l...@geek-
    > central.gen.new_zealand> wrote:
    >
    >> > - It's not practical to take "doing things efficiently" out of "doing
    >> > things right".

    >>
    >> Doing things right must come first.

    >
    > But my point still stands.


    Saying your point stands doesn’t make it stand.

    >>>> Threading is a performance hack.

    >>
    >>> Not always. It can be a way to cope with operations that block,
    >>> especially inhomogeneous ones.

    >>
    >> The usual *nix way of dealing with those is forking, not threading.

    >
    > For windows the usual way(I'm told) is threading, forking not
    > performing well, and I'd argue that this led to instability of much
    > windows software.
    > For *nix, I agree, but for some applications the need for sharing data
    > leads to shared memory, mutexes, potential for race conditions, and so
    > on, and you've got most of the downside of threading.


    The one thing you don’t get is sharing-by-default. Instead, everything you
    want shared must be explicitly shared. That already avoids a lot of
    problems.
    Lawrence D'Oliveiro, Oct 11, 2010
    #16
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lawrence D'Oliveiro

    QOTW

    Lawrence D'Oliveiro, Nov 9, 2010, in forum: NZ Computing
    Replies:
    0
    Views:
    305
    Lawrence D'Oliveiro
    Nov 9, 2010
Loading...

Share This Page