Changes in / [8364209:b067d9b]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/concurrency/Paper.tex

    r8364209 rb067d9b  
    253253\lstMakeShortInline@%
    254254
     255\newcommand{\commenttd}[1]{{\color{red}{Thierry : #1}}}
     256
    255257\let\OLDthebibliography\thebibliography
    256258\renewcommand\thebibliography[1]{
     
    970972% }
    971973% int main() {
    972 % 
     974%
    973975%       for ( int i = 0; i < 10; i += 1 ) {
    974976%               printf( "%d\n", fib() );
     
    17071709                if ( random() % 3 ) transfer( b1, b2, 7 );
    17081710        }
    1709 }   
     1711}
    17101712int main() {
    17111713        `Person p1 = { b1, b2 }, p2 = { b2, b1 };`
     
    17371739                if ( random() % 3 ) transfer( b1, b2, 7 );
    17381740        }
    1739 }   
     1741}
    17401742int main() {
    17411743        `thread p1(person, ref(b1), ref(b2)), p2(person, ref(b2), ref(b1));`
     
    19151917% forall( otype T ) { // distribute forall
    19161918%       monitor Buffer {
    1917 % 
     1919%
    19181920%               int front, back, count;
    19191921%               T elements[10];
     
    19271929%               if ( count == 10 ) `waitfor( remove, buffer )`;
    19281930%               // insert elem into buffer
    1929 % 
     1931%
    19301932%       }
    19311933%       T remove( Buffer(T) & mutex buffer ) with(buffer) {
    19321934%               if ( count == 0 ) `waitfor( insert, buffer )`;
    19331935%               // remove elem from buffer
    1934 % 
     1936%
    19351937%               return elem;
    19361938%       }
     
    25402542% \section{Parallelism}
    25412543% \label{s:Parallelism}
    2542 % 
     2544%
    25432545% Historically, computer performance was about processor speeds.
    25442546% However, with heat dissipation being a direct consequence of speed increase, parallelism is the new source for increased performance~\cite{Sutter05, Sutter05b}.
     
    25472549% However, kernel threads are better as an implementation tool because of complexity and higher cost.
    25482550% Therefore, different abstractions are often layered onto kernel threads to simplify them, \eg pthreads.
    2549 % 
    2550 % 
     2551%
     2552%
    25512553% \subsection{User Threads}
    2552 % 
     2554%
    25532555% A direct improvement on kernel threads is user threads, \eg Erlang~\cite{Erlang} and \uC~\cite{uC++book}.
    25542556% This approach provides an interface that matches the language paradigms, gives more control over concurrency by the language runtime, and an abstract (and portable) interface to the underlying kernel threads across operating systems.
     
    25562558% Like kernel threads, user threads support preemption, which maximizes nondeterminism, but increases the potential for concurrency errors: race, livelock, starvation, and deadlock.
    25572559% \CFA adopts user-threads to provide more flexibility and a low-cost mechanism to build any other concurrency approach, \eg thread pools and actors~\cite{Actors}.
    2558 % 
     2560%
    25592561% A variant of user thread is \newterm{fibres}, which removes preemption, \eg Go~\cite{Go} @goroutine@s.
    25602562% Like functional programming, which removes mutation and its associated problems, removing preemption from concurrency reduces nondeterminism, making race and deadlock errors more difficult to generate.
Note: See TracChangeset for help on using the changeset viewer.