Changes in / [b067d9b:8364209]
- File:
-
- 1 edited
-
doc/papers/concurrency/Paper.tex (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/concurrency/Paper.tex
rb067d9b r8364209 253 253 \lstMakeShortInline@% 254 254 255 \newcommand{\commenttd}[1]{{\color{red}{Thierry : #1}}}256 257 255 \let\OLDthebibliography\thebibliography 258 256 \renewcommand\thebibliography[1]{ … … 972 970 % } 973 971 % int main() { 974 % 972 % 975 973 % for ( int i = 0; i < 10; i += 1 ) { 976 974 % printf( "%d\n", fib() ); … … 1709 1707 if ( random() % 3 ) transfer( b1, b2, 7 ); 1710 1708 } 1711 } 1709 } 1712 1710 int main() { 1713 1711 `Person p1 = { b1, b2 }, p2 = { b2, b1 };` … … 1739 1737 if ( random() % 3 ) transfer( b1, b2, 7 ); 1740 1738 } 1741 } 1739 } 1742 1740 int main() { 1743 1741 `thread p1(person, ref(b1), ref(b2)), p2(person, ref(b2), ref(b1));` … … 1917 1915 % forall( otype T ) { // distribute forall 1918 1916 % monitor Buffer { 1919 % 1917 % 1920 1918 % int front, back, count; 1921 1919 % T elements[10]; … … 1929 1927 % if ( count == 10 ) `waitfor( remove, buffer )`; 1930 1928 % // insert elem into buffer 1931 % 1929 % 1932 1930 % } 1933 1931 % T remove( Buffer(T) & mutex buffer ) with(buffer) { 1934 1932 % if ( count == 0 ) `waitfor( insert, buffer )`; 1935 1933 % // remove elem from buffer 1936 % 1934 % 1937 1935 % return elem; 1938 1936 % } … … 2542 2540 % \section{Parallelism} 2543 2541 % \label{s:Parallelism} 2544 % 2542 % 2545 2543 % Historically, computer performance was about processor speeds. 2546 2544 % However, with heat dissipation being a direct consequence of speed increase, parallelism is the new source for increased performance~\cite{Sutter05, Sutter05b}. … … 2549 2547 % However, kernel threads are better as an implementation tool because of complexity and higher cost. 2550 2548 % Therefore, different abstractions are often layered onto kernel threads to simplify them, \eg pthreads. 2551 % 2552 % 2549 % 2550 % 2553 2551 % \subsection{User Threads} 2554 % 2552 % 2555 2553 % A direct improvement on kernel threads is user threads, \eg Erlang~\cite{Erlang} and \uC~\cite{uC++book}. 2556 2554 % 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. … … 2558 2556 % Like kernel threads, user threads support preemption, which maximizes nondeterminism, but increases the potential for concurrency errors: race, livelock, starvation, and deadlock. 2559 2557 % \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 % 2561 2559 % A variant of user thread is \newterm{fibres}, which removes preemption, \eg Go~\cite{Go} @goroutine@s. 2562 2560 % 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.