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