Changes in / [7951100:08b5a7e]
- File:
-
- 1 edited
-
doc/papers/concurrency/Paper.tex (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/concurrency/Paper.tex
r7951100 r08b5a7e 213 213 \lstMakeShortInline@% 214 214 215 \newcommand{\commenttd}[1]{{\color{red}{Thierry : #1}}}216 217 215 \let\OLDthebibliography\thebibliography 218 216 \renewcommand\thebibliography[1]{ … … 306 304 `&`r3 = &y; `&&`r3 = &`&`r4; // change r1, r2: cancel implicit dereferences (&*)**r3, (&(&*)*)*r3, &(&*)r4 307 305 \end{cfa} 308 A reference is a handle to an object, like a pointer, but is automatically dereferenced bythe specified number of levels.306 A reference is a handle to an object, like a pointer, but is automatically dereferenced the specified number of levels. 309 307 Referencing (address-of @&@) a reference variable cancels one of the implicit dereferences, until there are no more implicit references, after which normal expression behaviour applies. 310 308 … … 476 474 477 475 The signature feature of \CFA is parametric-polymorphic routines~\cite{} with routines generalized using a @forall@ clause (giving the language its name), which allow separately compiled routines to support generic usage over multiple types. 478 For example, the following sum routine works for any type that supports construction from 0 and addition \commenttd{constructors have not been introduced yet.}:476 For example, the following sum routine works for any type that supports construction from 0 and addition: 479 477 \begin{cfa} 480 478 forall( otype T | { void `?{}`( T *, zero_t ); T `?+?`( T, T ); } ) // constraint type, 0 and + … … 528 526 { 529 527 VLA x, y = { 20, 0x01 }, z = y; $\C{// z points to y}$ 530 // x{}; y{ 20, 0x01 }; z{ z, y }; 528 // x{}; y{ 20, 0x01 }; z{ z, y }; 531 529 ^x{}; $\C{// deallocate x}$ 532 530 x{}; $\C{// reallocate x}$ … … 565 563 The resulting execution system now follows a cooperative threading-model, called \newterm{non-preemptive scheduling}. 566 564 567 Because the scheduler is special, it can either be a stackless or stackfull coroutine. \commenttd{I dislike this sentence, it seems imply 1-step vs 2-step but also seems to say that some kind of coroutine is required, which is not the case.}565 Because the scheduler is special, it can either be a stackless or stackfull coroutine. 568 566 For stackless, the scheduler performs scheduling on the stack of the current coroutine and switches directly to the next coroutine, so there is one context switch. 569 567 For stackfull, the current coroutine switches to the scheduler, which performs scheduling, and it then switches to the next coroutine, so there are two context switches. 570 A stackfull scheduler is often used for simplicity and security, even through there is a slightly higher runtime-cost. \commenttd{I'm not a fan of the fact that we don't quantify this but yet imply it is negligeable.}568 A stackfull scheduler is often used for simplicity and security, even through there is a slightly higher runtime-cost. 571 569 572 570 Regardless of the approach used, a subset of concurrency related challenges start to appear. … … 773 771 }; 774 772 void main( Format & fmt ) with( fmt ) { 775 for ( ;; ) { 773 for ( ;; ) { 776 774 for ( g = 0; g < 5; g += 1 ) { // group 777 775 for ( b = 0; b < 4; b += 1 ) { // block
Note:
See TracChangeset
for help on using the changeset viewer.