Actually, it converts the asynchronous commands from the threads or forks into a single synchronous stream. This mimicks an early IBM-mainframe style solution to transaction processing from way back.

With all the inherent problems of those early attempts to deal with this problem.

The basic problem with serialising commands from asynchronous threads of executions (TOE), is that they frequently, very rapidly descend into lock-step. This where all the threads bar one end up waiting for the current thread to complete. And when it does, then next gets to do one thing, then the next. And before the queue is played out, the original thread has joined the end and you are into a cycle.

And that cycle consists of each thread doing some trivial amount of processing before blocking on the shared resource and then having to wait several context switches for all the other TOEs to have their chance. The net result is that throughput slows to a crawl.

The modern incarnation of the idea, Software Transactional Memory, avoids some of the problems of the older manifestations by using very optimistic operations. That is, instead of waiting on a lock before going forward with operations, they go ahead on the assumption that it's okay, and then check after to see if it was; and redo the operation if it wasn't.

However, despite the the big guns in concurrency research-- Edinburgh, Brown et al.--having done a huge amount of intensive research on STM in the past few years, I'm unaware of any practical implementations outside of the pure functional languages. And even there, there is good evidence that for generic real-world workloads, thread starvation--individual threads that make no progress--is a frequent problem with no solution. And that well crafted lock-free solutions beat STM for performance, throughput and fairness.


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.

In reply to Re^7: Sharing large data structures between threads by BrowserUk
in thread Sharing large data structures between threads by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.