- Timestamp:
- Sep 11, 2023, 12:55:43 PM (13 months ago)
- Branches:
- master
- Children:
- c8ec58e
- Parents:
- 3ee8853
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/text/CFA_concurrency.tex
r3ee8853 r9509d67a 12 12 \VRef[Listing]{l:cfa_thd_init} shows a typical examples of creating a \CFA user-thread type, and then as declaring processor ($N$) and thread objects ($M$). 13 13 \begin{cfa}[caption={Example of \CFA user thread and processor creation},label={l:cfa_thd_init}] 14 @thread@ my_thread { $\C{// user thread type (like structure }$14 @thread@ my_thread { $\C{// user thread type (like structure)}$ 15 15 ... // arbitrary number of field declarations 16 16 }; … … 21 21 @processor@ p[2]; $\C{// add 2 processors = 3 total with starting processor}$ 22 22 { 23 @my_thread@ t[2], * t3 = new(); $\C{// create 3 user threads, running in routine main}$23 @my_thread@ t[2], * t3 = new(); $\C{// create 2 stack allocated, 1 dynamic allocated user threads}$ 24 24 ... // execute concurrently 25 delete( t3 ); $\C{// wait for t hreadto end and deallocate}$26 } // wait for threadsto end and deallocate25 delete( t3 ); $\C{// wait for t3 to end and deallocate}$ 26 } // wait for threads t[0] and t[1] to end and deallocate 27 27 } // deallocate additional kernel threads 28 28 \end{cfa}
Note: See TracChangeset
for help on using the changeset viewer.