Changeset 07c1e595 for doc/proposals/concurrency/text/together.tex
- Timestamp:
- Nov 21, 2017, 1:30:00 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 9f10d1f2
- Parents:
- 5f91d650
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/proposals/concurrency/text/together.tex
r5f91d650 r07c1e595 7 7 8 8 \section{Threads as monitors} 9 As it was subt ely alluded in section \ref{threads}, \code{threads} in \CFA are in fact monitors, which means that all monitor features are available when using threads. For example, here is a very simple two thread pipeline that could be used for a simulator of a game engine :9 As it was subtly alluded in section \ref{threads}, \code{threads} in \CFA are in fact monitors, which means that all monitor features are available when using threads. For example, here is a very simple two thread pipeline that could be used for a simulator of a game engine : 10 10 \begin{cfacode} 11 11 // Visualization declaration … … 20 20 void draw( Renderer & mutex this, Frame * frame ); 21 21 22 // Simu alation loop22 // Simulation loop 23 23 void main( Simulator & this ) { 24 24 while( true ) { … … 49 49 void draw( Renderer & mutex this, Frame * frame ); 50 50 51 // Simu alation loop51 // Simulation loop 52 52 void main( Simulator & this ) { 53 53 while( true ) { … … 78 78 79 79 \section{Fibers \& Threads} 80 As mention ned in section \ref{preemption}, \CFA uses preemptive threads by default but can use fibers on demand. Currently, using fibers is done by adding the following line of code to the program~:80 As mentioned in section \ref{preemption}, \CFA uses preemptive threads by default but can use fibers on demand. Currently, using fibers is done by adding the following line of code to the program~: 81 81 \begin{cfacode} 82 82 unsigned int default_preemption() {
Note: See TracChangeset
for help on using the changeset viewer.