Changeset 2d831a1 for doc


Ignore:
Timestamp:
May 8, 2023, 4:53:10 PM (13 months ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
84018e0
Parents:
c0527f8
Message:

added various small edits and resolved some action items

Location:
doc/theses/colby_parsons_MMAth/text
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/colby_parsons_MMAth/text/CFA_concurrency.tex

    rc0527f8 r2d831a1  
    3030When processors are added, they are added alongside the existing processor given to each program.
    3131Thus, for $N$ processors, allocate $N-1$ processors.
    32 A thread is implicitly joined at deallocated, either implicitly at block exit for stack allocation or explicitly at @delete@ for heap allocation.
     32A thread is implicitly joined at deallocation, either implicitly at block exit for stack allocation or explicitly at @delete@ for heap allocation.
    3333The thread performing the deallocation must wait for the thread to terminate before the deallocation can occur.
    3434A thread terminates by returning from the main routine where it starts.
  • doc/theses/colby_parsons_MMAth/text/CFA_intro.tex

    rc0527f8 r2d831a1  
    1010Beyond C, it adds productivity features, extended libraries, an advanced type-system, and many control-flow/concurrency constructions.
    1111However, \CFA stays true to the C programming style, with most code revolving around @struct@'s and routines, and respects the same rules as C.
    12 \CFA is not object oriented as it has no notion of @this@ (receiver) and no structures with methods, but supports some object oriented ideas including constructors, destructors, and limited containment inheritance.
     12\CFA is not object oriented as it has no notion of @this@ (receiver) and no structures with methods, but supports some object oriented ideas including constructors, destructors, and limited nominal inheritance.
    1313While \CFA is rich with interesting features, only the subset pertinent to this work is discussed.
    1414
     
    128128\section{Polymorphism}\label{s:poly}
    129129C supports limited polymorphism, often requiring users to implement polymorphism using a @void *@ (type erasure) approach.
    130 \CFA extends C with generalized overloading polymorphism (see \VRef{s:Overloading}), as well as, parametric polymorphism and limited containment inheritance.
     130\CFA extends C with generalized overloading polymorphism (see \VRef{s:Overloading}), as well as, parametric polymorphism and limited nominal inheritance.
    131131
    132132\subsection{Parametric Polymorphism}
     
    180180
    181181\subsection{Inheritance}
    182 Inheritance in \CFA is taken from Plan-9 C's containment inheritance.
     182Inheritance in \CFA is taken from Plan-9 C's nominal inheritance.
    183183In \CFA, @struct@s can @inline@ another struct type to gain its fields and masquerade as that type.
    184 Examples of \CFA containment inheritance are shown in \VRef[Listing]{l:cfa_inherit}.
    185 
    186 \begin{cfa}[caption={Example of \CFA containment inheritance},label={l:cfa_inherit}]
     184Examples of \CFA nominal inheritance are shown in \VRef[Listing]{l:cfa_inherit}.
     185
     186\begin{cfa}[caption={Example of \CFA nominal inheritance},label={l:cfa_inherit}]
    187187struct one_d { double x; };
    188188struct two_d {
  • doc/theses/colby_parsons_MMAth/text/actors.tex

    rc0527f8 r2d831a1  
    673673
    674674\section{Performance}\label{s:actor_perf}
     675\CAP{I will update the figures to have the larger font size and different line markers once we start editing this chapter.}
    675676The performance of \CFA's actor system is tested using a suite of microbenchmarks, and compared with other actor systems.
    676677Most of the benchmarks are the same as those presented in \ref{}, with a few additions.
  • doc/theses/colby_parsons_MMAth/text/channels.tex

    rc0527f8 r2d831a1  
    1313Both languages are highly restrictive.
    1414Kahn's language restricts a reading process to only wait for data on a single channel at a time and different writing processes cannot send data on the same channel.
    15 Hoare's language restricts ...
     15Hoare's language restricts channels such that both the sender and receiver need to explicitly name the process that is destination of a channel send or the source of a channel receive.
     16These channel semantics remove the ability to have an anonymous sender or receiver and additionally all channel operations in CSP are synchronous (no buffering).
    1617Channels as a programming language feature has been popularized in recent years by the language Go, which encourages the use of channels as its fundamental concurrent feature.
    17 Go's restrictions are ...
     18Go's restrictions are ... \CAP{The only restrictions in Go but not CFA that I can think of are the closing semantics and the functionality of select vs. waituntil. Is that worth mentioning here or should it be discussed later?}
    1819\CFA channels do not have these restrictions.
    1920
     
    2324In the problem, threads interact with a buffer in two ways: producing threads insert values into the buffer and consuming threads remove values from the buffer.
    2425In general, a buffer needs protection to ensure a producer only inserts into a non-full buffer and a consumer only removes from a non-empty buffer (synchronization).
    25 As well, a buffer needs protection at each end resulting from concurrent access by multiple producers or consumers attempt to insert or remove simultaneously (MX).
     26As well, a buffer needs protection from concurrent access by multiple producers or consumers attempt to insert or remove simultaneously (MX).
    2627
    2728Channels come in three flavours of buffers:
     
    3435Infinite sized (unbounded) implies the communication is asynchronous, \ie the producer never waits but the consumer waits when the buffer is empty.
    3536Since memory is finite, all unbounded buffers are ultimately bounded;
    36 this restrict must be part of its implementation.
     37this restriction must be part of its implementation.
    3738\end{enumerate}
    3839
     
    4344
    4445\section{First-Come First-Served}
    45 As pointed out, a bounded buffer requires MX among multiple producers or consumers at either end of the buffer.
     46As pointed out, a bounded buffer requires MX among multiple producers or consumers.
    4647This MX should be fair among threads, independent of the FIFO buffer being fair among values.
    4748Fairness among threads is called \gls{fcfs} and was defined by Lamport~\cite[p.~454]{Lamport74}.
     
    6465
    6566\PAB{Discuss the Go channel implementation. Need to tie in FIFO buffer and FCFS locking.}
     67
    6668In this work, all channels are implemented with bounded buffers, so there is no zero-sized buffering.
     69\CAP{I do have zero size channels implemented, however I don't focus on them since I think they are uninteresting as they are just a thin layer over binary semaphores. Should I mention that I support it but omit discussion or just leave it out?}
    6770
    6871\section{Safety and Productivity}
  • doc/theses/colby_parsons_MMAth/text/mutex_stmt.tex

    rc0527f8 r2d831a1  
    2626
    2727\section{Monitor}
    28 \CFA provides a high-level locking object, called a \Newterm{monitor}, an elegant, efficient, high-level mechanisms for mutual exclusion and synchronization for shared-memory systems.
     28\CFA provides a high-level locking object, called a \Newterm{monitor}, an elegant and efficient abstraction for providing mutual exclusion and synchronization for shared-memory systems.
    2929First proposed by Brinch Hansen~\cite{Hansen73} and later described and extended by C.A.R.~Hoare~\cite{Hoare74}.
    3030Several concurrent programming languages provide monitors as an explicit language construct: \eg Concurrent Pascal~\cite{ConcurrentPascal}, Mesa~\cite{Mesa}, Turing~\cite{Turing:old}, Modula-3~\cite{Modula-3}, \uC~\cite{Buhr92a} and Java~\cite{Java}.
     
    111111To increase locking flexibility, some languages introduce a mutex statement.
    112112\VRef[Figure]{f:ReadersWriter} shows the outline of a reader/writer lock written as a \CFA monitor and mutex statements.
    113 (The exact lock implement is irrelevant.)
     113(The exact lock implementation is irrelevant.)
    114114The @read@ and @write@ functions are called with a reader/write lock and any arguments to perform reading or writing.
    115115The @read@ function is not MX because multiple readers can read simultaneously.
     
    359359\begin{cfa}[caption={Deadlock avoidance bendchmark pseudo code},label={l:deadlock_avoid_pseudo}]
    360360
    361 
    362 
    363 $\PAB{// add pseudo code}$
    364 
    365 
     361size_t N_LOCKS; $\C{// number of locks}$
     362size_t N_THREADS; $\C{// number of threads}$
     363size_t N_GENS; $\C{// number of random orderings (default 100)}$
     364size_t total = 0; $\C{// global throughput aggregator}$
     365volatile bool done = false; $\C{// termination flag}$
     366
     367test_spinlock locks[N_LOCKS];
     368size_t rands[N_THREADS][N_LOCKS * N_GENS]; $\C{// random ordering per thread}$
     369
     370void main( worker & w ) with(w) { $\C{// thread main}$
     371    size_t count = 0, idx = 0;
     372    while ( !done ) {
     373        idx = (count % N_LOCKS * N_GENS) * N_LOCKS; $\C{// get start of next sequence}$
     374        mutex(locks[rands[0]], ..., locks[rands[N_LOCKS - 1]]){} $\C{// lock sequence of locks}$
     375        count++;
     376    }
     377    __atomic_add_fetch(&total, count, __ATOMIC_SEQ_CST); $\C{// atomically add to total}$
     378}
     379
     380int main( int argc, char * argv[] ) {
     381    gen_orders(); $\C{// generate random orderings}$
     382    {
     383        worker w[N_THREADS];
     384        sleep( 10`s );
     385        done = true;
     386    }
     387    printf( "%lu\n", total );
     388}
    366389
    367390\end{cfa}
     
    379402
    380403Figure~\ref{f:mutex_bench} shows the results of the benchmark experiments.
    381 \PAB{Make the points in the graphs for each line different.
    382 Also, make the text in the graphs larger.}
    383404The baseline results for both languages are mostly comparable, except for the 8 locks results in \ref{f:mutex_bench8_AMD} and \ref{f:mutex_bench8_Intel}, where the \CFA baseline is slightly slower.
    384405The avoidance result for both languages is significantly different, where \CFA's mutex statement achieves throughput that is magnitudes higher than \CC's @scoped_lock@.
Note: See TracChangeset for help on using the changeset viewer.