Some approaches to concurrency are (passingly) referenced below... what are your favourites? Got any others?
Feel free to argue about the benefits/costs of paradigms, and please correct me if I'm dead wrong.
Some observations:
- Many-core seems inevitable (inc app-specific processors: GPUs, Cell-BE)
- Multiple concurrency paradigms exist right now!
- Languages and users are generally not ready to consume those paradigms
- There's a lack of discussion of pro-concurrent data-structs & algorithms
I've read these nodes:
I've read about the following
Task-Oriented Concurrency Paradigms:
| Name | Details | Perl? |
| Threads/Processes & Locks | Failure is hard. Hard to debug, hard to scale, locks don't compose.
Includes shared nothing architectures like web-apps/services. | You are here. |
| Implicitly Parallel Operations | Failure is hard. Hard to debug. Doesn't scale. | Perl6 Hyper-operators |
| Message Passing | (Smalltalk, Erlang) Failure easily handled. Optimised for size, highly scalable. | Interpreter is too heavy. |
| Software Transactional Memory | (Haskell) Failure is normal. Hard to optimise. Good composability. Won't scale. | Needs pure FP. |
| Co-operative event APIs | (POE) Failure is hard. East to debug. Limited composability. Good scalability. | Absolutely. |
| Combined lightweight threading + events APIs | (H/O Actors) Async everything, hard to debug, too many small functions | Needs pure, *modern* FP. |
I've read about the following Data-Oriented Concurrency Paradigms:
| Name | Details | Perl? |
| Ad-hoc Message Passing | (MPI, PVM) O/S or library based. Poor composability. Scales well. | Yes. |
| Pipeline of Iterators/Lazies | (Haskell, Perl6) Failure is hard. Good composibility. Hard to scale. | Perl6 lists, co-routines. |
| Data Parallelism | (LINQ) Hard to debug. Limited effect. Good composability. Hard to scale. | Needs pure FP. |
| Nested Data Parallelism | (DP-Haskell) Failure is awkward. Good composability. Highly scalable. | Needs pure, *modern* FP. |
All the above paradigms try to address concurrency in a very general way.
There are also concurrency-friendly data-structures & algorithms:
- For easiest implementation: need to make guarantees that are difficult in imperative or non-pure languages.
- In general though, can be used anywhere locks and threads/processes are available.
- Application domain dependent, requires high quality education (out of reach).
Perl misses out on lots of cool concurrency "gear" because:
- Type system doesn't (at least) annotate side-effects, doesn't make safety guarantees.
- Lack of pure functions and real currying for generalised composition.
- The interpreter is heavy (this may get a little better).
- Doesn't have powerful enough macros (yet?) and can't do "term-rewriting & fusion" (DP-Haskell).
References:
Software Transactional Memory
Nested Data Parallelism
Haller/Odersky Actors
Erlang
Parallel Data-Stucts & Algs
Data Parallel Haskell
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.