Changes in / [b067d9b:8364209]


Ignore:
File:
1 edited

Legend:

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

    rb067d9b r8364209  
    253253\lstMakeShortInline@%
    254254
    255 \newcommand{\commenttd}[1]{{\color{red}{Thierry : #1}}}
    256 
    257255\let\OLDthebibliography\thebibliography
    258256\renewcommand\thebibliography[1]{
     
    972970% }
    973971% int main() {
    974 %
     972% 
    975973%       for ( int i = 0; i < 10; i += 1 ) {
    976974%               printf( "%d\n", fib() );
     
    17091707                if ( random() % 3 ) transfer( b1, b2, 7 );
    17101708        }
    1711 }
     1709}   
    17121710int main() {
    17131711        `Person p1 = { b1, b2 }, p2 = { b2, b1 };`
     
    17391737                if ( random() % 3 ) transfer( b1, b2, 7 );
    17401738        }
    1741 }
     1739}   
    17421740int main() {
    17431741        `thread p1(person, ref(b1), ref(b2)), p2(person, ref(b2), ref(b1));`
     
    19171915% forall( otype T ) { // distribute forall
    19181916%       monitor Buffer {
    1919 %
     1917% 
    19201918%               int front, back, count;
    19211919%               T elements[10];
     
    19291927%               if ( count == 10 ) `waitfor( remove, buffer )`;
    19301928%               // insert elem into buffer
    1931 %
     1929% 
    19321930%       }
    19331931%       T remove( Buffer(T) & mutex buffer ) with(buffer) {
    19341932%               if ( count == 0 ) `waitfor( insert, buffer )`;
    19351933%               // remove elem from buffer
    1936 %
     1934% 
    19371935%               return elem;
    19381936%       }
     
    25422540% \section{Parallelism}
    25432541% \label{s:Parallelism}
    2544 %
     2542% 
    25452543% Historically, computer performance was about processor speeds.
    25462544% However, with heat dissipation being a direct consequence of speed increase, parallelism is the new source for increased performance~\cite{Sutter05, Sutter05b}.
     
    25492547% However, kernel threads are better as an implementation tool because of complexity and higher cost.
    25502548% Therefore, different abstractions are often layered onto kernel threads to simplify them, \eg pthreads.
    2551 %
    2552 %
     2549% 
     2550% 
    25532551% \subsection{User Threads}
    2554 %
     2552% 
    25552553% A direct improvement on kernel threads is user threads, \eg Erlang~\cite{Erlang} and \uC~\cite{uC++book}.
    25562554% 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.
     
    25582556% Like kernel threads, user threads support preemption, which maximizes nondeterminism, but increases the potential for concurrency errors: race, livelock, starvation, and deadlock.
    25592557% \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}.
    2560 %
     2558% 
    25612559% A variant of user thread is \newterm{fibres}, which removes preemption, \eg Go~\cite{Go} @goroutine@s.
    25622560% 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.