Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Where is concurrency going? Is Perl going there?

by dmitri (Curate)
on Jul 27, 2007 at 01:22 UTC ( #629036=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Where is concurrency going? Is Perl going there?
in thread Where is concurrency going? Is Perl going there?

Well, I am not sure about theoreticians and their boxes, but I most certainly hate debugging threaded programs, be it C, C++, or anything else.

To me, "thread" is spelled f-o-r-k. To each his own, I s'pose.


Comment on Re^3: Where is concurrency going? Is Perl going there?
Re^4: Where is concurrency going? Is Perl going there?
by BrowserUk (Pope) on Jul 27, 2007 at 02:00 UTC

    If I have a problem that will benefit from concurrency, and doesn't need ongoing shared access to data, (and if I'm on a platform that has fork available), I'd probably use fork. Though, if no data sharing is required, then running independent subroutines in separate threads is just as easy to debug. Run each thread individually until it is (percieved) bug free and then start them all.

    But there are a whole class of problems that need ongoing access to shared data.

    Forked solutions to these problems mean serialising data and passing it (bidirectionally) through pipes or sockets, and that adds far more complexity and is even harder to debug than threads. Flattening and reconstituting compound data-structures is one problem. Coordinating bi-directional communications another. Synchronisation between processes is just as hard, and equally fraught with deadlocks and priority inversions as is synchronisation between threads.

    All the difficulties of concurrency exists regardless of the unit of concurrency (processes or threads) used. The only difference is that when using processes, communications is slower and adds complexity. The only way to handle bi-directional asynchronous communications without threads, is to use a select model state machine. State machines are far harder to program than the linear flows that can be used when you have threads.


    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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2014-10-02 02:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (43 votes), past polls