Ignore:
Timestamp:
Apr 3, 2023, 1:34:02 PM (15 months ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
1689ecf
Parents:
48fda7a
Message:

Big cleanup pass. Updated style to get rid of almost all macros. Reformated thesis to match current template. Added newlines at the end of all sentences. Reworked terminology and acronyms to fit new glossary format

File:
1 edited

Legend:

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

    r48fda7a r9a5a2cd  
    11\chapter{Concurrency in \CFA}\label{s:cfa_concurrency}
    22
    3 The groundwork for concurrency in \CFA was laid by Thierry Delisle in his Master's Thesis\cite{Delisle18}. In that work he introduced coroutines, user level threading, and monitors. Not listed in that work were the other concurrency features that were needed as building blocks, such as locks, futures, and condition variables which he also added to \CFA.
     3The groundwork for concurrency in \CFA was laid by Thierry Delisle in his Master's Thesis\cite{Delisle18}.
     4In that work he introduced coroutines, user level threading, and monitors.
     5Not listed in that work were the other concurrency features that were needed as building blocks, such as locks, futures, and condition variables which he also added to \CFA.
    46
    57\section{Threading Model}\label{s:threading}
    6 \CFA has user level threading and supports a $M:N$ threading model where $M$ user threads are scheduled on $N$ cores, where both $M$ and $N$ can be explicitly set by the user. Cores are used by a program by creating instances of a \code{processor} struct. User threads types are defined using the \code{thread} keyword, in the place where a \code{struct} keyword is typically used. For each thread type a corresponding main must be defined, which is where the thread starts running once it is created. Listing~\ref{l:cfa_thd_init} shows an example of processor and thread creation. When processors are added, they are added alongside the existing processor given to each program. Thus if you want $N$ processors you need to allocate $N-1$. To join a thread the thread must be deallocated, either deleted if it is allocated on the heap, or go out of scope if stack allocated. The thread performing the deallocation will wait for the thread being deallocated to terminate before the deallocation can occur. A thread terminates by returning from the main routine where it starts.
     8\CFA has user level threading and supports a $M:N$ threading model where $M$ user threads are scheduled on $N$ cores, where both $M$ and $N$ can be explicitly set by the user.
     9Cores are used by a program by creating instances of a \code{processor} struct.
     10User threads types are defined using the \code{thread} keyword, in the place where a \code{struct} keyword is typically used.
     11For each thread type a corresponding main must be defined, which is where the thread starts running once it is created.
     12Listing~\ref{l:cfa_thd_init} shows an example of processor and thread creation.
     13When processors are added, they are added alongside the existing processor given to each program.
     14Thus if you want $N$ processors you need to allocate $N-1$.
     15To join a thread the thread must be deallocated, either deleted if it is allocated on the heap, or go out of scope if stack allocated.
     16The thread performing the deallocation will wait for the thread being deallocated to terminate before the deallocation can occur.
     17A thread terminates by returning from the main routine where it starts.
    718
    819\begin{cfacode}[tabsize=3,caption={\CFA user thread and processor creation},label={l:cfa_thd_init}]
Note: See TracChangeset for help on using the changeset viewer.