Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: About self-invoked threads into class

by sundialsvc4 (Abbot)
on Jun 01, 2012 at 19:06 UTC ( #973845=note: print w/ replies, xml ) Need Help??


in reply to Re: About self-invoked threads into class
in thread About self-invoked threads into class

... It is quite likely that this explanation will not convince you ...

Such a thorough and well-reasoned explanation certainly should convince anyone.   Upvoted.

“Threads” are all-too-often seen as being equivalent to “a unit of work,” when in fact they should be seen as a “worker.”   (The difference between someone who’s cooking a hamburger, and the hamburger itself.)   The diff between success and failure, between something that is efficient and something that can be considerably slower than “no threads at all,” is the workflow structure that surrounds those workers.   (That’s what Ray Kroc saw in the MacDonald brothers’ hamburger stand:   a better process.)   The OP’s design as it stands now, even if made to “work,” won’t hold a candle to what it properly should.


Comment on Re^2: About self-invoked threads into class
Re^3: About self-invoked threads into class
by BrowserUk (Pope) on Jun 01, 2012 at 19:49 UTC
    Such a thorough and well-reasoned explanation certainly should convince anyone.

    Maybe, (and thanks), but the reality is that for many people who have come from Java and other multi-processing backgrounds, my explanation won't necessarily ring true, because it goes against much of what they were taught in colleges; or read in (often highly recommended) books (see the real time section:barriers; latches; exchangers) and on training courses.

    There has been -- and still is in many circles -- far too much emphasis placed on synchronisation -- which creates all the bad guys of multiprograminig as listed under "Realtime Anti-Patterns". If you don't synchronise at all, none of the bad guys can happen.

    (The difference between someone who’s cooking a hamburger, and the hamburger itself.)

    I don't think your burger analogy helps much here. The problem lies not (so much) in work-unit .v. worker, but in how the workers communicate.

    The best analogy I have is the difference between old-school voice mail; and those dratted call-center "Your message is in a queue and will be answered shortly - tick-tock -- We're sorry but due to the high volume of calls there are no free agents; please hold" queuing systems.

    The problem is not the queue per se, but the synchronicity of that queue from the callers perspective. From the call center's perspective, it is an efficient way of distributing the workload. But from the caller's perspective, having to stand around listening to the typical "Your call is important to us..." lies is just dead, wasted cycles.

    On the other hand, voice mail allows me to ask my question and get on with something else until an agent becomes free and calls me back. Ie. It is a (pair of) asynchronous queues.

    Of course, the downside of that is the phone tag game. It can happen in bi-directional queuing also.

    The solution is promises (also known as futures; also known as deferred synchronicity).


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://973845]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (11)
As of 2014-10-01 17:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (31 votes), past polls