Changeset b726084
- Timestamp:
- Nov 9, 2016, 2:51:42 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:
- 30b65d8, d073e3c
- Parents:
- 141b786 (diff), 84118d8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 3 added
- 1 deleted
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r141b786 rb726084 12 12 libcfa/Makefile 13 13 src/Makefile 14 version 14 15 15 16 # genereted by premake -
Makefile.in
r141b786 rb726084 132 132 CFA_PREFIX = @CFA_PREFIX@ 133 133 CFLAGS = @CFLAGS@ 134 CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@135 134 CPP = @CPP@ 136 135 CPPFLAGS = @CPPFLAGS@ -
configure
r141b786 rb726084 1 1 #! /bin/sh 2 2 # Guess values for system-dependent variables and create Makefiles. 3 # Generated by GNU Autoconf 2.68 for cfa-cc 1.0.0. 3 # Generated by GNU Autoconf 2.68 for cfa-cc 1.0.0.0. 4 4 # 5 5 # Report bugs to <cforall@plg.uwaterloo.ca>. … … 561 561 PACKAGE_NAME='cfa-cc' 562 562 PACKAGE_TARNAME='cfa-cc' 563 PACKAGE_VERSION='1.0.0 '564 PACKAGE_STRING='cfa-cc 1.0.0 '563 PACKAGE_VERSION='1.0.0.0' 564 PACKAGE_STRING='cfa-cc 1.0.0.0' 565 565 PACKAGE_BUGREPORT='cforall@plg.uwaterloo.ca' 566 566 PACKAGE_URL='' … … 646 646 CFA_BACKEND_CC 647 647 BACKEND_CC 648 CONFIG_STATUS_DEPENDENCIES649 648 MAINT 650 649 MAINTAINER_MODE_FALSE … … 1279 1278 # This message is too long to be a string in the A/UX 3.1 sh. 1280 1279 cat <<_ACEOF 1281 \`configure' configures cfa-cc 1.0.0 to adapt to many kinds of systems.1280 \`configure' configures cfa-cc 1.0.0.0 to adapt to many kinds of systems. 1282 1281 1283 1282 Usage: $0 [OPTION]... [VAR=VALUE]... … … 1345 1344 if test -n "$ac_init_help"; then 1346 1345 case $ac_init_help in 1347 short | recursive ) echo "Configuration of cfa-cc 1.0.0 :";;1346 short | recursive ) echo "Configuration of cfa-cc 1.0.0.0:";; 1348 1347 esac 1349 1348 cat <<\_ACEOF … … 1449 1448 if $ac_init_version; then 1450 1449 cat <<\_ACEOF 1451 cfa-cc configure 1.0.0 1450 cfa-cc configure 1.0.0.0 1452 1451 generated by GNU Autoconf 2.68 1453 1452 … … 2037 2036 running configure, to aid debugging if configure makes a mistake. 2038 2037 2039 It was created by cfa-cc $as_me 1.0.0 , which was2038 It was created by cfa-cc $as_me 1.0.0.0, which was 2040 2039 generated by GNU Autoconf 2.68. Invocation command line was 2041 2040 … … 2901 2900 # Define the identity of the package. 2902 2901 PACKAGE='cfa-cc' 2903 VERSION='1.0.0 '2902 VERSION='1.0.0.0' 2904 2903 2905 2904 … … 2965 2964 # may require auto* software to be installed 2966 2965 2967 ver_major=`cat version | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/\1/'` 2968 ver_minor=`cat version | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/\2/'` 2969 ver_patch=`cat version | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/\3/'` 2970 ver_build=`cat version | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/\4/'` 2971 ver_short="\"${ver_major}\"" 2972 ver__long="\"${ver_major}.${ver_minor}\"" 2973 ver__norm="\"${ver_major}.${ver_minor}.${ver_patch}\"" 2974 ver__full="\"${ver_major}.${ver_minor}.${ver_patch}.${ver_build}\"" 2975 2976 CONFIG_STATUS_DEPENDENCIES='$(top_srcdir)/version' 2977 2966 rm -f version 2967 echo ${PACKAGE_VERSION} > version # file containing version number for other tools 2968 chmod ugo-w version 2969 ver_major=`cut -d '.' -f1 version` # subdivide version number into components at periods 2970 ver_minor=`cut -d '.' -f2 version` 2971 ver_patch=`cut -d '.' -f3 version` 2972 ver_build=`cut -d '.' -f4 version` 2973 2974 # AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/version']) 2978 2975 2979 2976 cat >>confdefs.h <<_ACEOF … … 2998 2995 2999 2996 cat >>confdefs.h <<_ACEOF 3000 #define CFA_VERSION_SHORT ${ver_short}2997 #define CFA_VERSION_SHORT "${ver_major}" 3001 2998 _ACEOF 3002 2999 3003 3000 3004 3001 cat >>confdefs.h <<_ACEOF 3005 #define CFA_VERSION ${ver__long}3002 #define CFA_VERSION "${ver_major}.${ver_minor}" 3006 3003 _ACEOF 3007 3004 3008 3005 3009 3006 cat >>confdefs.h <<_ACEOF 3010 #define CFA_VERSION_LONG ${ver__norm}3007 #define CFA_VERSION_LONG "${ver_major}.${ver_minor}.${ver_patch}" 3011 3008 _ACEOF 3012 3009 3013 3010 3014 3011 cat >>confdefs.h <<_ACEOF 3015 #define CFA_VERSION_FULL ${ver__full}3012 #define CFA_VERSION_FULL "${ver_major}.${ver_minor}.${ver_patch}.${ver_build}" 3016 3013 _ACEOF 3017 3014 … … 6404 6401 # values after options handling. 6405 6402 ac_log=" 6406 This file was extended by cfa-cc $as_me 1.0.0 , which was6403 This file was extended by cfa-cc $as_me 1.0.0.0, which was 6407 6404 generated by GNU Autoconf 2.68. Invocation command line was 6408 6405 … … 6470 6467 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" 6471 6468 ac_cs_version="\\ 6472 cfa-cc config.status 1.0.0 6469 cfa-cc config.status 1.0.0.0 6473 6470 configured by $0, generated by GNU Autoconf 2.68, 6474 6471 with options \\"\$ac_cs_config\\" -
configure.ac
r141b786 rb726084 3 3 4 4 AC_PREREQ([2.68]) 5 AC_INIT([cfa-cc],[1.0.0 ],[cforall@plg.uwaterloo.ca])5 AC_INIT([cfa-cc],[1.0.0.0],[cforall@plg.uwaterloo.ca]) 6 6 AC_CONFIG_AUX_DIR([automake]) 7 7 #AC_CONFIG_SRCDIR([src/main.cc]) … … 18 18 AM_MAINTAINER_MODE(enable) # may require auto* software to be installed 19 19 20 ver_major=`cat version | sed -r 's/([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)/\1/'` 21 ver_minor=`cat version | sed -r 's/([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)/\2/'` 22 ver_patch=`cat version | sed -r 's/([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)/\3/'` 23 ver_build=`cat version | sed -r 's/([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)/\4/'` 24 ver_short="\"${ver_major}\"" 25 ver__long="\"${ver_major}.${ver_minor}\"" 26 ver__norm="\"${ver_major}.${ver_minor}.${ver_patch}\"" 27 ver__full="\"${ver_major}.${ver_minor}.${ver_patch}.${ver_build}\"" 20 rm -f version 21 echo ${PACKAGE_VERSION} > version # file containing version number for other tools 22 chmod ugo-w version 23 ver_major=`cut -d '.' -f1 version` # subdivide version number into components at periods 24 ver_minor=`cut -d '.' -f2 version` 25 ver_patch=`cut -d '.' -f3 version` 26 ver_build=`cut -d '.' -f4 version` 28 27 29 AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/version'])28 # AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/version']) 30 29 AC_DEFINE_UNQUOTED(CFA_VERSION_MAJOR, ${ver_major}, [Major version number.]) 31 30 AC_DEFINE_UNQUOTED(CFA_VERSION_MINOR, ${ver_minor}, [Minor version number.]) 32 31 AC_DEFINE_UNQUOTED(CFA_VERSION_PATCH, ${ver_patch}, [Patch version number.]) 33 32 AC_DEFINE_UNQUOTED(CFA_VERSION_BUILD, ${ver_build}, [Build version number.]) 34 AC_DEFINE_UNQUOTED(CFA_VERSION_SHORT, ${ver_short}, [Major])35 AC_DEFINE_UNQUOTED(CFA_VERSION, ${ver__long}, [Major.Minor])36 AC_DEFINE_UNQUOTED(CFA_VERSION_LONG, ${ver__norm}, [Major.Minor.Patch])37 AC_DEFINE_UNQUOTED(CFA_VERSION_FULL, ${ver__full}, [Major.Minor.Patch.Build])33 AC_DEFINE_UNQUOTED(CFA_VERSION_SHORT, ["${ver_major}"], [Major]) 34 AC_DEFINE_UNQUOTED(CFA_VERSION, ["${ver_major}.${ver_minor}"], [Major.Minor]) 35 AC_DEFINE_UNQUOTED(CFA_VERSION_LONG, ["${ver_major}.${ver_minor}.${ver_patch}"], [Major.Minor.Patch]) 36 AC_DEFINE_UNQUOTED(CFA_VERSION_FULL, ["${ver_major}.${ver_minor}.${ver_patch}.${ver_build}"], [Major.Minor.Patch.Build]) 38 37 39 38 # Installation paths -
doc/bibliography/cfa.bib
r141b786 rb726084 21 21 % tcs: Theoretical Computer Science 22 22 @string{ieeepds="IEEE Transactions on Parallel and Distributed Systems"} 23 % @string{ieeepds="IEEE Trans. Parallel Distrib. Syst."} 23 24 @string{ieeese="IEEE Transactions on Software Engineering"} 25 % @string{ieeese="IEEE Trans. Softw. Eng."} 24 26 @string{spe="Software---\-Practice and Experience"} 27 % @string{spe="Softw. Pract. Exp."} 28 @string{ccpe="Concurrency and Computation: Practice and Experience"} 29 % @string{ccpe="Concurrency Comput. Pract. Exp."} 25 30 @string{sigplan="SIGPLAN Notices"} 31 % @string{sigplan="SIGPLAN Not."} 26 32 @string{joop="Journal of Object-Oriented Programming"} 33 % @string{joop="J. of Object-Oriented Program."} 27 34 @string{popl="Conference Record of the ACM Symposium on Principles of Programming Languages"} 28 35 @string{osr="Operating Systems Review"} 29 36 @string{pldi="Programming Language Design and Implementation"} 37 @string{mathann="Mathematische Annalen"} 38 % @string{mathann="Math. Ann."} 30 39 31 40 % A … … 39 48 booktitle = {Parallel Programming in {C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}}}, 40 49 publisher = {MIT Press}, 50 address = {New York}, 41 51 series = {Scientific and Engineering Computation Series}, 42 52 year = 1996, … … 120 130 year = 1996, 121 131 pages = {483-499}, 122 publisher = {Addison-Wesley Longman Publishing Co., Inc.},123 address = {Boston , MA, USA},132 publisher = {Addison-Wesley Longman Publishing}, 133 address = {Boston}, 124 134 } 125 135 … … 161 171 author = {Gul A. Agha}, 162 172 title = {Actors: A Model of Concurrent Computation in Distributed Systems}, 163 publisher = {MIT Press, Cambridge , Mass.},173 publisher = {MIT Press, Cambridge}, 164 174 year = 1986 165 175 } … … 311 321 publisher = {Microsoft Press}, 312 322 year = 1997, 313 edition = { third},323 edition = {3rd}, 314 324 } 315 325 … … 325 335 year = 1977, 326 336 pages = {604-605}, 337 } 338 339 @manual{Akka, 340 keywords = {Akka actor model}, 341 contributer = {pabuhr@plg}, 342 title = {{A}kka {S}cala Documentation, Release 2.4.11}, 343 organization= {Lightbend Inc.}, 344 month = sep, 345 year = 2016, 346 note = {\href{http://doc.akka.io/docs/akka/2.4/AkkaScala.pdf}{http://\-doc.akka.io/\-docs/\-akka/\-2.4/\-AkkaScala.pdf}}, 327 347 } 328 348 … … 378 398 author = {M. Raynal}, 379 399 title = {Algorithms for Mutual Exclusion}, 380 publisher = { TheMIT Press},381 address = {Cambridge , Massachusetts},400 publisher = {MIT Press}, 401 address = {Cambridge}, 382 402 series = {Scientific Computation Series}, 383 403 year = 1986, … … 394 414 pages = {329-342}, 395 415 publisher = {Springer}, 416 address = {New York}, 396 417 year = 2005, 397 418 volume = 3669, … … 404 425 editor = {Richard L. Sites}, 405 426 title = {Alpha Architecture Reference Manual}, 406 publisher = {Digital Press, One Burlington Woods Drive, Burlington, MA, U. S. A., 01803},427 publisher = {Digital Press, Burlington}, 407 428 year = 1992, 408 429 } … … 413 434 editor = {Mary Shaw}, 414 435 title = {{ALPHARD}: Form and Content}, 415 publisher = {Springer-Verlag}, 436 publisher = {Springer}, 437 address = {New York}, 416 438 year = 1981, 417 439 comment = {Collection of papers about Alphard.} … … 470 492 editor = {Gul Agha and Peter Wegner and Akinori Yonezawa}, 471 493 publisher = {MIT Press}, 494 address = {New York}, 472 495 year = 1993, 473 496 pages = {107-150}, … … 495 518 location = {Toulouse, France}, 496 519 doi = {http://doi.acm.org/10.1145/318773.319251}, 497 publisher = {Springer -Verlag},520 publisher = {Springer}, 498 521 address = {London, UK}, 499 522 } … … 504 527 title = {The Annotated {C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}} Reference Manual}, 505 528 publisher = {Addison-Wesley}, 529 address = {Boston}, 506 530 year = 1990, 507 edition = { first},531 edition = {1st}, 508 532 } 509 533 … … 567 591 year = 2008, 568 592 isbn = {0123705916, 9780123705914}, 569 publisher = {Morgan Kaufmann Publishers Inc.},570 address = {San Francisco , CA, USA},593 publisher = {Morgan Kaufmann Publishers}, 594 address = {San Francisco}, 571 595 } 572 596 … … 747 771 } 748 772 773 @misc{BoostCoroutines15, 774 keywords = {Boost Coroutine Library}, 775 contributer = {pabuhr@plg}, 776 author = {Oliver Kowalke}, 777 title = {Boost Coroutine Library}, 778 year = 2015, 779 note = {\href{http://www.boost.org/doc/libs/1_61_0/libs/coroutine/doc/html/index.html} 780 {{http://www.boost.org/\-doc/\-libs/1\_61\_0/\-libs/\-coroutine/\-doc/\-html/\-index.html}} [Accessed September 2016]}, 781 } 782 749 783 @mastersthesis{Krischer02, 750 784 author = {Roy Krischer }, … … 779 813 editor = {C. Dony and J. L. Knudsen and A. Romanovsky and A. Tripathi}, 780 814 booktitle = {Advanced Topics in Exception Handling Techniques}, 781 publisher = {Springer -Verlag},815 publisher = {Springer}, 782 816 series = {Lecture Notes in Computer Science}, 783 817 volume = 4119, … … 793 827 author = {Brian W. Kernighan and Dennis M. Ritchie}, 794 828 title = {The {C} Programming Language}, 795 publisher = {Prentice Hall}, 829 publisher = {Prentice-Hall}, 830 address = {Englewood Cliffs}, 796 831 year = 1988, 797 edition = { second},798 series = {Prentice 832 edition = {2nd}, 833 series = {Prentice-Hall Software Series}, 799 834 comment = { 800 835 based on draft-proposed ANSI C … … 807 842 author = {Brian W. Kernighan and Dennis M. Ritchie}, 808 843 title = {The {C} Programming Language}, 809 publisher = {Prentice Hall}, 844 publisher = {Prentice-Hall}, 845 address = {Englewood Cliffs}, 810 846 year = 1978, 811 edition = { first},847 edition = {1st}, 812 848 } 813 849 … … 835 871 836 872 @manual{C++Concepts, 837 keywords= {ISO/IEC TS 19217:2015},838 contributer= {a3moss@uwaterloo.ca},839 key= {C++ Concepts},840 title= {Information technology -- Programming languages -- {C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}} Extensions for concepts},841 organization= {International Standard ISO/IEC TS 19217:2015},842 publisher= {International Standard Organization},843 address= {http://www.iso.org},844 year= 2015873 keywords = {ISO/IEC TS 19217:2015}, 874 contributer = {a3moss@uwaterloo.ca}, 875 key = {C++ Concepts}, 876 title = {Information technology -- Programming languages -- {C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}} Extensions for concepts}, 877 organization= {International Standard ISO/IEC TS 19217:2015}, 878 publisher = {International Standard Organization}, 879 address = {http://www.iso.org}, 880 year = 2015 845 881 } 846 882 … … 914 950 title = {{C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}} Primer}, 915 951 publisher = {Addison-Wesley}, 952 address = {Boston}, 916 953 year = 1991, 917 edition = { second},954 edition = {2nd}, 918 955 note = {QA76.73.C15L57}, 919 956 } … … 925 962 title = {The {C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}} Programming Language}, 926 963 publisher = {Addison-Wesley}, 964 address = {Boston}, 927 965 year = 1986, 928 edition = { first},966 edition = {1st}, 929 967 series = {Addison-Wesley Series in Computer Science} 930 968 } … … 936 974 title = {The {C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}} Programming Language}, 937 975 publisher = {Addison-Wesley}, 976 address = {Boston}, 938 977 year = 1991, 939 edition = { second},978 edition = {2nd}, 940 979 } 941 980 … … 945 984 author = {Bjarne Stroustrup}, 946 985 title = {The {C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}} Programming Language}, 947 publisher = {Addison -Wesley},986 publisher = {Addison Wesley Longman}, 948 987 year = 1997, 949 edition = { third},988 edition = {3rd}, 950 989 } 951 990 … … 1002 1041 title = {Classics in Software Engineering}, 1003 1042 publisher = {Yourdon Press}, 1043 address = {New York}, 1004 1044 year = 1979, 1005 1045 } … … 1042 1082 Moss and J. Craig Schaffert and Robert Scheifler and Alan Snyder}, 1043 1083 title = {CLU Reference Manual}, 1044 publisher = {Springer-Verlag}, 1084 publisher = {Springer}, 1085 address = {New York}, 1045 1086 year = 1981, 1046 1087 volume = 114, … … 1053 1094 key = {Cobol14}, 1054 1095 title = {Programming Languages -- {Cobol}}, 1055 edition = { second},1096 edition = {2nd}, 1056 1097 organization= {International Standard ISO/IEC 1989:2014}, 1057 1098 publisher = {International Standard Organization}, … … 1106 1147 title = {Commentary on Standard {ML}}, 1107 1148 publisher = {MIT Press}, 1108 address = {Cambridge , Massachusetts, U.S.A.},1149 address = {Cambridge}, 1109 1150 year = 1991 1110 1151 } … … 1132 1173 year = 1987, 1133 1174 pages = {151-170}, 1134 publisher = {Springer -Verlag}1175 publisher = {Springer} 1135 1176 } 1136 1177 … … 1138 1179 keywords = {common lisp}, 1139 1180 contributer = {pabuhr@plg}, 1140 author = {G .Steele},1181 author = {Guy Steele}, 1141 1182 title = {COMMON LISP: The Language}, 1142 1183 publisher = {Digital Press}, 1184 address = {New York}, 1143 1185 year = 1984 1144 1186 } … … 1183 1225 year = 1985, 1184 1226 isbn = {0-13-153271-5}, 1185 publisher = {Prentice-Hall , Inc.},1227 publisher = {Prentice-Hall}, 1186 1228 address = {Upper Saddle River, NJ, USA}, 1187 1229 note = {\href{http://www.usingcsp.com/cspbook.pdf}{http://\-www.usingcsp.com/\-cspbook.pdf}}, … … 1202 1244 author = {Alfred V. Aho and Monica S. Lam and Ravi Sethi and Jeffrey D. Ullman}, 1203 1245 title = {Compilers: Principles, Techniques, and Tools}, 1204 edition = { second},1246 edition = {2nd}, 1205 1247 year = {2006}, 1206 publisher = {Addison-Wesley Longman Publishing Co., Inc.},1248 publisher = {Addison-Wesley Longman Publishing}, 1207 1249 address = {Boston, MA, USA}, 1208 1250 } … … 1212 1254 contributer = {pabuhr@plg}, 1213 1255 author = {David F. Bacon and Susan L. Graham and Oliver J. Sharp}, 1214 title = {Compiler Transformations for High-Performance Com puting},1256 title = {Compiler Transformations for High-Performance Com\-puting}, 1215 1257 journal = acmcs, 1216 1258 volume = 26, … … 1250 1292 month = sep, 1251 1293 address = {Waterloo, Ontario, Canada, N2L 3G1}, 1252 note = { {\small\textsf{ftp://\-plg.uwaterloo.ca/\-pub/\-theses/\-MokThesis.ps.gz}}},1294 note = {\href{http://plg.uwaterloo.ca/theses/MokThesis.pdf}{http://\-plg.uwaterloo.ca/\-theses/\-MokThesis.pdf}}, 1253 1295 } 1254 1296 … … 1328 1370 editor = {P. E. Lauer}, 1329 1371 pages = {165-198}, 1330 publisher = {Springer -Verlag},1372 publisher = {Springer}, 1331 1373 address = {Berlin, DE}, 1332 1374 year = 1993, … … 1393 1435 month = jul, 1394 1436 year = 2015, 1395 note = {\href{http://plg.uwaterloo.ca/~usystem/pub/uSystem/u++-6.1.0.sh}{\textsf{http:// plg.uwaterloo.ca/\-$\sim$usystem/\-pub/\-uSystem/\-u++-6.1.0.sh}}},1437 note = {\href{http://plg.uwaterloo.ca/~usystem/pub/uSystem/u++-6.1.0.sh}{\textsf{http://\-plg.\-uwaterloo.\-ca/\-$\sim$usystem/\-pub/\-uSystem/\-u++-6.1.0.sh}}}, 1396 1438 } 1397 1439 … … 1401 1443 author = {Alan Burns and Geoff Davies}, 1402 1444 title = {Concurrent Programming}, 1403 publisher = {Addison -Wesley},1445 publisher = {Addison Wesley Longman}, 1404 1446 year = 1993, 1405 1447 } … … 1424 1466 title = {Concurrent Programming in {J}ava: Design Principles and Patterns}, 1425 1467 publisher = {Addison-Wesley}, 1468 address = {Boston}, 1426 1469 year = 1997, 1427 edition = { first},1470 edition = {1st}, 1428 1471 } 1429 1472 … … 1435 1478 publisher = {Oxford University Press}, 1436 1479 year = 1998, 1437 edition = { first},1480 edition = {1st}, 1438 1481 } 1439 1482 … … 1444 1487 title = {Concurrent Programming in {J}ava: Design Principles and Patterns}, 1445 1488 publisher = {Addison-Wesley}, 1489 address = {Boston}, 1446 1490 year = 2000, 1447 edition = { second},1491 edition = {2nd}, 1448 1492 } 1449 1493 … … 1453 1497 author = {N. H. Gehani and W. D. Roome}, 1454 1498 title = {The {Concurrent C} Programming Language}, 1455 publisher = {Silicon Press, NJ}, 1499 publisher = {Silicon Press}, 1500 address = {Summit}, 1456 1501 year = 1989, 1457 1502 } … … 1462 1507 author = {Gregory R. Andrews}, 1463 1508 title = {Concurrent Programming: Principles and Practice}, 1464 publisher = {Benjamin/Cummings Publishing Company, Inc., Redwood City, California}, 1509 publisher = {Benjamin/Cummings Publish\-ing}, 1510 address = {Redwood City}, 1465 1511 year = 1991, 1466 1512 } … … 1471 1517 author = {Peter A. Buhr and Ashif S. Harji}, 1472 1518 title = {Concurrent Urban Legends}, 1473 journal = {Concurrency and Computation: Practice and Experience},1519 journal = ccpe, 1474 1520 month = aug, 1475 1521 year = 2005, … … 1497 1543 publisher = {Cambridge University Press}, 1498 1544 year = 1998, 1499 edition = { second},1545 edition = {2nd}, 1500 1546 } 1501 1547 … … 1514 1560 title = {Condition Handling in the Lisp Language Family}, 1515 1561 booktitle = {Exception Handling}, 1516 publisher = {Springer -Verlag},1562 publisher = {Springer}, 1517 1563 volume = 2022, 1518 1564 series = {LNCS}, … … 1527 1573 title = {Conformace, Genericity, Inheritance and Enhancement}, 1528 1574 pages = {223-233}, 1529 publisher = {Springer -Verlag},1575 publisher = {Springer}, 1530 1576 year = 1987, 1531 1577 volume = 276, … … 1636 1682 1637 1683 @unpublished{Ditchfield:conversions, 1638 contributer = {a3moss@uwaterloo.ca}, 1639 author = {Glen Ditchfield}, 1640 title = {Conversions for {Cforall}}, 1641 note = {\href{http://plg.uwaterloo.ca/~cforall/Conversions/index.html}{http://\-plg.uwaterloo.ca/\-\textasciitilde cforall/\-Conversions/\-index.html}}, 1642 month = {Nov}, 1643 year = {2002}, 1644 urldate = {28 July 2016}, 1645 } 1646 1684 contributer = {a3moss@uwaterloo.ca}, 1685 author = {Glen Ditchfield}, 1686 title = {Conversions for {Cforall}}, 1687 note = {\href{http://plg.uwaterloo.ca/~cforall/Conversions/index.html}{http://\-plg.uwaterloo.ca/\-\textasciitilde cforall/\-Conversions/\-index.html}}, 1688 month = {Nov}, 1689 year = {2002}, 1690 urldate = {28 July 2016}, 1691 } 1647 1692 1648 1693 @techreport{Dijkstra65, … … 1662 1707 author = {Christopher D. Marlin}, 1663 1708 title = {Coroutines: A Programming Methodology, a Language Design and an Implementation}, 1664 publisher = {Springer-Verlag}, 1709 publisher = {Springer}, 1710 address = {New York}, 1665 1711 year = 1980, 1666 1712 volume = 95, … … 1699 1745 publisher = {Benjamin Cummings}, 1700 1746 year = 1991, 1747 } 1748 1749 @article{Moore75, 1750 keywords = {approximation methods, integrated circuits}, 1751 contributer = {pabuhr@plg}, 1752 author = {Gordon E. Moore}, 1753 title = {Progress in Digital Integrated Electronics}, 1754 journal = {Technical Digest, International Electron Devices Meeting, IEEE}, 1755 year = 1975, 1756 pages = {11-13}, 1701 1757 } 1702 1758 … … 1840 1896 title = {The Definition of Standard {ML}}, 1841 1897 publisher = {MIT Press}, 1842 address = {Cambridge , Massachusetts, U.S.A.},1898 address = {Cambridge}, 1843 1899 year = 1990 1844 1900 } … … 1870 1926 author = {Peter A. Buhr and David Dice and Wim H. Hesselink}, 1871 1927 title = {Dekker's Mutual Exclusion Algorithm Made RW-Safe}, 1872 journal = {Concurrency and Computation: Practice and Experience},1928 journal = ccpe, 1873 1929 volume = 28, 1874 1930 number = 1, … … 1920 1976 title = {The Design and Evolution of {C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}}}, 1921 1977 publisher = {Addison-Wesley}, 1978 address = {Boston}, 1922 1979 year = 1994 1923 1980 } … … 1977 2034 author = {G. Motet and A. Mapinard and J. C. Geoffroy}, 1978 2035 title = {Design of Dependable {A}da Software}, 1979 publisher = {Prentice Hall}, 2036 publisher = {Prentice-Hall}, 2037 address = {Englewood Cliffs}, 1980 2038 year = 1996, 1981 2039 } … … 2012 2070 title = {Design Patterns: Elements of Reusable Object-Oriented Software}, 2013 2071 publisher = {Addison-Wesley}, 2072 address = {Boston}, 2014 2073 year = 1995, 2015 2074 series = {Professional Computing Series}, … … 2054 2113 author = {Ralph E. Johnson and Brian Foote}, 2055 2114 title = {Designing Reusable Classes}, 2056 journal = {Journal of Object-Oriented Programming},2115 journal = joop, 2057 2116 year = 1988, 2058 2117 volume = 1, number = 2, pages = {22-35}, … … 2109 2168 title = {A Discipline of Programming}, 2110 2169 publisher = {Prentice-Hall}, 2170 address = {Englewood Cliffs}, 2111 2171 year = 1976, 2112 2172 } … … 2125 2185 title = {Distributed Systems: Principles and Paradigms}, 2126 2186 publisher = {Prentice-Hall}, 2187 address = {Englewood Cliffs}, 2127 2188 year = 2002, 2128 2189 } … … 2253 2314 title = {Eiffel: The Language}, 2254 2315 publisher = {Prentice-Hall}, 2316 address = {Englewood Cliffs}, 2255 2317 year = 1992, 2256 series = {Prentice 2318 series = {Prentice-Hall Object-Oriented Series}, 2257 2319 } 2258 2320 … … 2388 2450 month = jun, 2389 2451 year = 2015, 2390 note = {\href{http://www.erlang.org/doc/pdf/otp-system-documentation.pdf}{\textsf{http://www.erlang.org/\-doc/\-pdf/\-otp-system- documentation.pdf}}},2452 note = {\href{http://www.erlang.org/doc/pdf/otp-system-documentation.pdf}{\textsf{http://www.erlang.org/\-doc/\-pdf/\-otp-system-\-documentation.pdf}}}, 2391 2453 } 2392 2454 … … 2467 2529 booktitle = {Advances in COMPUTERS}, 2468 2530 publisher = {Academic Press}, 2531 address = {London}, 2469 2532 volume = 56, 2470 2533 year = 2002, … … 2561 2624 title = {Exception Handling in Parallel Computations}, 2562 2625 journal = sigplan, 2626 publisher = {ACM}, 2627 address = {New York, NY, USA}, 2563 2628 volume = 20, 2564 2629 number = 10, 2565 2630 month = oct, 2566 2631 year = 1985, 2567 issn = {0362-1340},2568 2632 pages = {95-104}, 2569 url = {http://doi.acm.org/10.1145/382286.382385},2570 doi = {http://doi.acm.org/10.1145/382286.382385},2571 acmid = {382385},2572 publisher = {ACM},2573 address = {New York, NY, USA},2574 2633 } 2575 2634 … … 2680 2739 title = {Fault Tolerance and Exception Handling in {BETA}}, 2681 2740 booktitle = {Exception Handling}, 2682 publisher = {Springer -Verlag},2741 publisher = {Springer}, 2683 2742 volume = 2022, 2684 2743 series = {Lecture Notes in Computer Science}, … … 2839 2898 title = {A Fully Object-Oriented Exception Handling System: Rationale and Smalltalk Implementation}, 2840 2899 booktitle = {Exception Handling}, 2841 publisher = {Springer -Verlag},2900 publisher = {Springer}, 2842 2901 volume = 2022, 2843 2902 series = {Lecture Notes in Computer Science}, … … 2859 2918 series = {The Art of Computer Programming}, 2860 2919 publisher = {Addison-Wesley}, 2920 address = {Boston}, 2861 2921 year = 1973, 2862 2922 volume = 1, 2863 edition = { second},2923 edition = {2nd}, 2864 2924 } 2865 2925 … … 2912 2972 author = {Richard M. Stallman}, 2913 2973 organization= {Free Software Foundation}, 2914 address = {Cambridge , MA}2974 address = {Cambridge} 2915 2975 } 2916 2976 … … 2952 3012 } 2953 3013 2954 2955 3014 @article{Haskell, 2956 3015 keywords = {lazy evaluation, type class}, … … 2973 3032 organization= {Google}, 2974 3033 year = 2009, 2975 note = {\href{http://golang.org/ref/spec}{http:// golang.org/\-ref/\-spec}},3034 note = {\href{http://golang.org/ref/spec}{http://\-golang.org/\-ref/\-spec}}, 2976 3035 } 2977 3036 … … 3090 3149 author = {Robert E. Strom and David F. Bacon and Arthur P. Goldberg and Andy Lowry and Daniel M. Yellin and Shaula Alexander Yemini}, 3091 3150 title = {Hermes: A Language for Distributed Computing}, 3092 publisher = {Prentice Hall}, 3151 publisher = {Prentice-Hall}, 3152 address = {Englewood Cliffs}, 3093 3153 series = {Innovative Technology}, 3094 3154 year = 1991, … … 3134 3194 author = {Peter A. Buhr and David Dice and Wim H. Hesselink}, 3135 3195 title = {High-Performance {$N$}-Thread Software Solutions for Mutual Exclusion}, 3136 journal = {Concurrency and Computation: Practice and Experience},3196 journal = ccpe, 3137 3197 volume = 27, 3138 3198 number = 3, … … 3148 3208 title = {Zum Hilbertschen Aufbau der reellen Zahlen}, 3149 3209 publisher = {Springer}, 3150 journal = {Mathematische Annalen},3210 journal = mathann, 3151 3211 number = 1, 3152 3212 volume = 99, … … 3187 3247 title = {The Icon Programming Language}, 3188 3248 publisher = {Prentice-Hall}, 3249 address = {Englewood Cliffs}, 3189 3250 year = 1983, 3190 3251 } … … 3262 3323 issn = {0164-0925}, 3263 3324 pages = {1270--1343}, 3264 doi = {http://doi.acm.org/10.1145/1108970.1108975},3265 3325 publisher = {ACM Press}, 3266 3326 address = {New York, NY, USA}, … … 3277 3337 pages = {55-59}, 3278 3338 issn = {0163-5719}, 3279 doi = {http://doi.acm.org/10.1145/872736.806932}, 3280 } 3339 } 3281 3340 3282 3341 @book{Algol68, … … 3361 3420 title = {Interacting Processes: A Multiparty Approach to Coordinated Distributed Programming}, 3362 3421 publisher = {Addison-Wesley}, 3422 address = {Boston}, 3363 3423 series = {ACM Press Books}, 3364 3424 year = 1996, … … 3434 3494 title = {Introduction to Algorithms}, 3435 3495 publisher = {MIT Press/McGraw-Hill}, 3496 address = {Cambridge}, 3436 3497 series = {Electrical Engineering and Computer Science Series}, 3437 3498 year = 1992, … … 3444 3505 title = {Introduction to Automata Theory, Languages and Computation}, 3445 3506 publisher = {Addison-Wesley}, 3507 address = {Boston}, 3446 3508 year = 1979, 3447 3509 } … … 3476 3538 title = {An Introduction to Operating Systems}, 3477 3539 publisher = {Addison-Wesley}, 3540 address = {Boston}, 3478 3541 year = 1990, 3479 edition = { second},3542 edition = {2nd}, 3480 3543 } 3481 3544 … … 3525 3588 title = {Issues with Exception Hnadling in Object-Oriented Systems}, 3526 3589 booktitle = {ECOOP'97}, 3527 publisher = {Springer -Verlag},3590 publisher = {Springer}, 3528 3591 volume = 1241, 3529 3592 series = {Lecture Notes in Computer Science}, … … 3553 3616 title = {The {Java} Language Specification}, 3554 3617 publisher = {Addison-Wesley}, 3618 address = {Reading}, 3555 3619 year = 2000, 3556 edition = { second},3620 edition = {2nd}, 3557 3621 } 3558 3622 … … 3597 3661 title = {Konstruktion nichtrekursiver Funktionen}, 3598 3662 publisher = {Springer}, 3599 journal = {Mathematische Annalen},3663 journal = mathann, 3600 3664 number = 111, 3601 3665 volume = 1, … … 3740 3804 title = {Lisp 1.5 Primer}, 3741 3805 publisher = {Dickenson Publishing}, 3806 address = {Belmont}, 3742 3807 year = 1967, 3743 3808 } … … 3937 4002 booktitle = {Proceedings of the European Conference on Object Oriented Programming}, 3938 4003 organization= {ECOOP'88}, 3939 publisher = {Springer -Verlag},4004 publisher = {Springer}, 3940 4005 volume = 322, 3941 4006 editor = {S. Gjessing and K. Nygaard}, … … 3979 4044 title = {Modern C++ Design: Generic Programming and Design Patterns Applied}, 3980 4045 publisher = {Addison-Wesley Professional}, 4046 address = {Boston}, 3981 4047 month = feb, 3982 4048 year = 2001, … … 3990 4056 title = {Modern Operating Systems}, 3991 4057 publisher = {Prentice-Hall}, 4058 address = {Englewood Cliffs}, 3992 4059 year = 1992, 3993 4060 } … … 4310 4377 title = {Nesting in an Object Oriented Language is NOT for the Birds}, 4311 4378 booktitle = {Proceedings of the European Conference on Object Oriented Programming}, 4312 publisher = {Springer -Verlag},4379 publisher = {Springer}, 4313 4380 volume = 322, 4314 4381 editor = {S. Gjessing and K. Nygaard}, … … 4437 4504 editor = {S. Gjessing and K. Nygaard}, 4438 4505 organization= {DND, The Norwegian Computer Society}, 4439 publisher = {Springer -Verlag},4506 publisher = {Springer}, 4440 4507 comment = { 4441 4508 Objectives: … … 4472 4539 title = {Object-oriented programming; an evolutionary approach}, 4473 4540 publisher = {Addison-Wesley}, 4541 address = {Boston}, 4474 4542 year = 1986 4475 4543 } … … 4481 4549 title = {Object-oriented Programming in the {BETA} Programming Language}, 4482 4550 publisher = {Addison-Wesley}, 4551 address = {Boston}, 4483 4552 year = 1993, 4484 4553 } … … 4512 4581 author = {Bertrand Meyer}, 4513 4582 title = {Object-oriented Software Construction}, 4514 publisher = {Prentice Hall}, 4583 publisher = {Prentice-Hall}, 4584 address = {Englewood Cliffs}, 4515 4585 year = {1988}, 4516 series = {Prentice 4586 series = {Prentice-Hall International Series in Computer Science}, 4517 4587 } 4518 4588 … … 4541 4611 author = {John Galletly}, 4542 4612 title = {{OCCAM} 2: Including {OCCAM} 2.1}, 4543 publisher = {{UCL} (University College London) Press Ltd.}, 4544 edition = {second}, 4613 publisher = {{UCL} (University College London) Press}, 4614 address = {London}, 4615 edition = {2nd}, 4545 4616 year = 1996, 4546 4617 } … … 4602 4673 month = jul, 4603 4674 year = 2013, 4604 note = {\href{http://www.openmp.org/mp-documents/OpenMP4.0.0.pdf}{\textsf{http:// www.openmp.org/mp-documents/OpenMP4.0.0.pdf}}},4675 note = {\href{http://www.openmp.org/mp-documents/OpenMP4.0.0.pdf}{\textsf{http://\-www.openmp.org/\-mp-documents/\-OpenMP4.0.0.pdf}}}, 4605 4676 } 4606 4677 … … 4611 4682 title = {Operating Systems}, 4612 4683 publisher = {Pearson Prentice-Hall}, 4684 address = {Englewood Cliffs}, 4613 4685 year = 2004, 4614 edition = { third},4686 edition = {3rd}, 4615 4687 } 4616 4688 … … 4621 4693 title = {Operating Systems: Internals and Design Principles}, 4622 4694 publisher = {Prentice-Hall}, 4695 address = {Englewood Cliffs}, 4623 4696 year = 1998, 4624 edition = { third},4697 edition = {3rd}, 4625 4698 } 4626 4699 … … 4631 4704 title = {Operating Systems: Internals and Design Principles}, 4632 4705 publisher = {Prentice-Hall}, 4706 address = {Englewood Cliffs}, 4633 4707 year = 2001, 4634 edition = { fourth},4708 edition = {4th}, 4635 4709 } 4636 4710 … … 4641 4715 title = {Operating System Concepts}, 4642 4716 publisher = {Addision-Wesley}, 4717 address = {Boston}, 4643 4718 year = 1991, 4644 edition = { third},4719 edition = {3rd}, 4645 4720 } 4646 4721 … … 4651 4726 title = {Operating Systems : Design and Implementation}, 4652 4727 publisher = {Prentice-Hall}, 4728 address = {Englewood Cliffs}, 4653 4729 series = {Software Series}, 4654 4730 year = 1987, … … 4661 4737 title = {Operating System Principles}, 4662 4738 publisher = {Prentice-Hall}, 4739 address = {Englewood Cliffs}, 4663 4740 year = 1973, 4664 4741 } … … 4670 4747 title = {Operating System Principles}, 4671 4748 publisher = {Prentice-Hall}, 4749 address = {Englewood Cliffs}, 4672 4750 year = 2003, 4673 4751 } … … 4686 4764 4687 4765 @article{Ganzinger80, 4688 contributer= {a3moss@uwaterloo.ca},4689 author= {Ganzinger, Harald and Ripken, Knut},4690 title= {Operator Identification in {ADA}: Formal Specification, Complexity, and Concrete Implementation},4691 journal= {SIGPLAN Notices},4692 issue_date= {February 1980},4693 volume= {15},4694 number= {2},4695 month= feb,4696 year= {1980},4697 issn= {0362-1340},4698 pages= {30--42},4699 numpages= {13},4700 url= {http://doi.acm.org/10.1145/947586.947589},4701 doi= {10.1145/947586.947589},4702 publisher= {ACM},4703 address= {New York, NY, USA}4766 contributer = {a3moss@uwaterloo.ca}, 4767 author = {Ganzinger, Harald and Ripken, Knut}, 4768 title = {Operator Identification in {ADA}: Formal Specification, Complexity, and Concrete Implementation}, 4769 journal = {SIGPLAN Notices}, 4770 issue_date = {February 1980}, 4771 volume = {15}, 4772 number = {2}, 4773 month = feb, 4774 year = {1980}, 4775 issn = {0362-1340}, 4776 pages = {30--42}, 4777 numpages = {13}, 4778 url = {http://doi.acm.org/10.1145/947586.947589}, 4779 doi = {10.1145/947586.947589}, 4780 publisher = {ACM}, 4781 address = {New York, NY, USA} 4704 4782 } 4705 4783 … … 4723 4801 title = {{OS} and {DOS} {PL/I} Reference Manual}, 4724 4802 organization= {International Business Machines}, 4725 edition = { first},4803 edition = {1st}, 4726 4804 month = sep, 4727 4805 year = 1981, … … 4843 4921 booktitle = {Parallel Programming in {C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}}}, 4844 4922 publisher = {MIT Press}, 4845 address = {Cambridge , MA, USA},4923 address = {Cambridge}, 4846 4924 series = {Scientific and Engineering Computation Series}, 4847 4925 pages = {507-546}, … … 4922 5000 publisher = {Springer--Verlag}, 4923 5001 year = 1985, 4924 edition = { third},5002 edition = {3rd}, 4925 5003 note = {Revised by Andrew B. Mickel and James F. Miner, ISO Pascal Standard} 4926 5004 } … … 4933 5011 publisher = {Springer--Verlag}, 4934 5012 year = 1975, 4935 edition = { first},5013 edition = {1st}, 4936 5014 } 4937 5015 … … 4955 5033 title = {{P}ascal/{VS} Language Reference Manual}, 4956 5034 organization= {International Business Machines}, 4957 edition = { first},5035 edition = {1st}, 4958 5036 year = 1981, 4959 5037 note = {Manual SH20-6168-1}, … … 5107 5185 title = {Principles of Concurrent Programming}, 5108 5186 publisher = {Prentice-Hall International}, 5187 address = {Englewood Cliffs}, 5109 5188 year = 1982, 5110 5189 } … … 5114 5193 title = {Principles of Programming Languages}, 5115 5194 publisher = {Prentice-Hall International}, 5195 address = {Englewood Cliffs}, 5116 5196 year = 1981, 5117 5197 series = {Series in Computer Science} … … 5185 5265 title = {Programming with {POSIX} Threads}, 5186 5266 publisher = {Addison-Wesley}, 5267 address = {Boston}, 5187 5268 series = {Professional Computing}, 5188 5269 year = 1997, … … 5194 5275 author = {J. T. Schwartz and R. B. K. Dewar and E. Dubinsky and E. Schonberg}, 5195 5276 title = {Programming with Sets: An Introduction to {SETL}}, 5196 publisher = {Springer -Verlag},5277 publisher = {Springer}, 5197 5278 year = 1986, 5198 5279 } … … 5235 5316 key = {C++14}, 5236 5317 title = {Programming Languages -- {C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}}}, 5237 edition = { fourth},5318 edition = {4th}, 5238 5319 organization= {International Standard ISO/IEC 14882:2014 (E)}, 5239 5320 publisher = {International Standard Organization}, … … 5329 5410 author = {Niklaus Wirth}, 5330 5411 title = {Programming in Modula-2}, 5331 publisher = {Springer-Verlag}, 5412 publisher = {Springer}, 5413 address = {New York}, 5332 5414 year = 1988, 5333 edition = { fourth},5415 edition = {4th}, 5334 5416 series = {Texts and Monographs in Computer Science}, 5335 5417 } … … 5343 5425 month = feb, 5344 5426 year = 1983, 5345 note = { Published by Springer-Verlag}5427 note = {Springer, New York}, 5346 5428 } 5347 5429 … … 5351 5433 title = {The Programming Language {Ada}: Reference Manual}, 5352 5434 organization= {United States Department of Defense}, 5353 publisher = {Springer -Verlag},5435 publisher = {Springer}, 5354 5436 year = 1981 5355 5437 } … … 5505 5587 5506 5588 @article{Grossman06, 5507 keywords= {Cyclone, existential types, polymorphism, type variables},5508 contributer= {a3moss@plg},5509 author= {Grossman, Dan},5510 title= {Quantified Types in an Imperative Language},5511 journal= toplas,5512 issue_date= {May 2006},5513 volume= {28},5514 number= {3},5515 month= may,5516 year= {2006},5517 issn= {0164-0925},5518 pages= {429--475},5519 numpages= {47},5520 url= {http://doi.acm.org.proxy.lib.uwaterloo.ca/10.1145/1133651.1133653},5521 doi= {10.1145/1133651.1133653},5522 acmid= {1133653},5523 publisher= {ACM},5524 address= {New York, NY, USA},5589 keywords = {Cyclone, existential types, polymorphism, type variables}, 5590 contributer = {a3moss@plg}, 5591 author = {Grossman, Dan}, 5592 title = {Quantified Types in an Imperative Language}, 5593 journal = toplas, 5594 issue_date = {May 2006}, 5595 volume = {28}, 5596 number = {3}, 5597 month = may, 5598 year = {2006}, 5599 issn = {0164-0925}, 5600 pages = {429--475}, 5601 numpages = {47}, 5602 url = {http://doi.acm.org.proxy.lib.uwaterloo.ca/10.1145/1133651.1133653}, 5603 doi = {10.1145/1133651.1133653}, 5604 acmid = {1133653}, 5605 publisher = {ACM}, 5606 address = {New York, NY, USA}, 5525 5607 } 5526 5608 … … 5569 5651 title = {{A}da Reference Manual}, 5570 5652 edition = {International Standard {ISO}/{IEC} {8652:1995(E)} with {COR.1:2000}}, 5571 organization 5653 organization= {Intermetrics, Inc.}, 5572 5654 month = dec, 5573 5655 year = 1995, … … 5579 5661 contributer = {pabuhr@plg}, 5580 5662 title = {Programming languages -- {Ada}}, 5581 edition = { third},5663 edition = {3rd}, 5582 5664 organization= {International Standard ISO/IEC 1989:2014}, 5583 5665 publisher = {International Standard Organization}, … … 5604 5686 series = {The Real-Time for Java Expert Group, {\small\textsf{http://\-www.rtj.org}}}, 5605 5687 publisher = {Addison-Wesley}, 5688 address = {Boston}, 5606 5689 year = 2000, 5607 5690 } … … 5755 5838 % S 5756 5839 5840 @manual{Scala, 5841 keywords = {Scala programming language}, 5842 contributer = {pabuhr@plg}, 5843 title = {{Scala} Language Specification, Version 2.11}, 5844 organization= {\'{E}cole Polytechnique F\'{e}d\'{e}rale de Lausanne}, 5845 year = 2016, 5846 note = {\href{http://www.scala-lang.org/files/archive/spec/2.11}{http://\-www.scala-lang.org/\-files/\-archive/\-spec/\-2.11}}, 5847 } 5848 5757 5849 @inproceedings{Michael04, 5758 5850 keywords = {lock free, dynamic memory allocation}, … … 5802 5894 pages = {51-67}, 5803 5895 editor = {G. Kahn and D. B. MacQueen and G. D. Plotkin}, 5804 publisher = {Springer -Verlag},5896 publisher = {Springer}, 5805 5897 note = {Lecture Notes in Computer Science v. 173}, 5806 5898 } … … 5852 5944 month = may, 5853 5945 year = 2001, 5854 note = { {\small\textsf{http://www.python.org/peps/pep-0255.html}}},5946 note = {\href{http://www.python.org/peps/pep-0255.html}{http://\-www.python.org/\-peps/\-pep-0255.html}}, 5855 5947 } 5856 5948 … … 5871 5963 5872 5964 @article{Pennello80, 5873 contributer= {a3moss@uwaterloo.ca},5874 author= {Pennello, Tom and DeRemer, Frank and Meyers, Richard},5875 title= {A Simplified Operator Identification Scheme for {Ada}},5876 journal= {SIGPLAN Notices},5877 issue_date= {July-August 1980},5878 volume= {15},5879 number= {7 and 8},5880 month= jul,5881 year= {1980},5882 issn= {0362-1340},5883 pages= {82--87},5884 numpages= {6},5885 url= {http://doi.acm.org/10.1145/947680.947688},5886 doi= {10.1145/947680.947688},5887 publisher= {ACM},5888 address= {New York, NY, USA},5965 contributer = {a3moss@uwaterloo.ca}, 5966 author = {Pennello, Tom and DeRemer, Frank and Meyers, Richard}, 5967 title = {A Simplified Operator Identification Scheme for {Ada}}, 5968 journal = {SIGPLAN Notices}, 5969 issue_date = {July-August 1980}, 5970 volume = {15}, 5971 number = {7 and 8}, 5972 month = jul, 5973 year = {1980}, 5974 issn = {0362-1340}, 5975 pages = {82--87}, 5976 numpages = {6}, 5977 url = {http://doi.acm.org/10.1145/947680.947688}, 5978 doi = {10.1145/947680.947688}, 5979 publisher = {ACM}, 5980 address = {New York, NY, USA}, 5889 5981 } 5890 5982 … … 5927 6019 year = {1980}, 5928 6020 address = {Lund, Sweden}, 5929 edition = { second},6021 edition = {2nd}, 5930 6022 } 5931 6023 5932 6024 @book{Simula67, 5933 author = "O-J Dahl and B. Myhrhaug and K. Nygaard",5934 address = "Oslo Norway",6025 author = {O-J Dahl and B. Myhrhaug and K. Nygaard}, 6026 title = {Simula67 Common Base Language}, 5935 6027 month = oct, 5936 6028 year = 1970, 5937 publisher = "Norwegian Computing Center",5938 title = "Simula67 Common Base Language"6029 publisher = {Norwegian Com\-puting Center}, 6030 address = {Oslo Norway}, 5939 6031 } 5940 6032 … … 5945 6037 title = {Smalltalk-80: The Language and its Implementation}, 5946 6038 publisher = {Addison-Wesley}, 6039 address = {Reading}, 5947 6040 year = 1983 5948 6041 } … … 5966 6059 author = {R. E. Griswold and J. F. Poage and I. P. Polonsky}, 5967 6060 title = {The SNOBOL4 Programming Language}, 5968 edition = { second},6061 edition = {2nd}, 5969 6062 publisher = {Prentice-Hall}, 6063 address = {Englewood Cliffs}, 5970 6064 year = 1971, 5971 6065 } … … 6073 6167 author = {R. H. Campbell and A. N. Habermann}, 6074 6168 title = {The Specification of Process Synchronization by Path Expressions}, 6075 publisher = {Springer -Verlag},6169 publisher = {Springer}, 6076 6170 year = 1974, 6077 6171 volume = 16, … … 6117 6211 title = {A Standard {ML} Compiler}, 6118 6212 booktitle = {Functional Programming Languages and Computer Architecture}, 6119 publisher = {Springer -Verlag},6213 publisher = {Springer}, 6120 6214 series = {Lecture Notes in Computer Science}, 6121 6215 volume = 274, … … 6172 6266 title = {Structured Concurrent Programming with Operating System Applications}, 6173 6267 publisher = {Addison-Wesley}, 6268 address = {Boston}, 6174 6269 year = 1978, 6175 6270 } … … 6320 6415 author = {Gadi Taubenfeld}, 6321 6416 title = {Synchronization Algorithms and Concurrent Programming}, 6322 publisher = {Pearson/Prentice Hall}, 6417 publisher = {Pearson/Prentice-Hall}, 6418 address = {Harlow, England}, 6323 6419 year = 2006, 6324 6420 } … … 6380 6476 author = {Andrew Birrell and Mark R. Brown and Luca Cardelli and Jim Donahue and Lucille Glassman and John Gutag and Jim Harning and Bill Kalsow and Roy Levin and Greg Nelson}, 6381 6477 title = {Systems Programming with Modula-3}, 6382 publisher = {Prentice-Hall, Inc.}, 6478 publisher = {Prentice-Hall}, 6479 address = {Englewood Cliffs}, 6383 6480 year = 1991, 6384 series = {Prentice 6481 series = {Prentice-Hall Series in Innovative Technology} 6385 6482 } 6386 6483 … … 6464 6561 pages = {408-423}, 6465 6562 editor = {B. Robinet}, 6466 publisher = {Springer -Verlag},6563 publisher = {Springer}, 6467 6564 note = {Lecture Notes in Computer Science, v. 19}, 6468 6565 abstract = { … … 6546 6643 publisher = {Holt Software Associates Inc.}, 6547 6644 year = 1992, 6548 edition = { third},6645 edition = {3rd}, 6549 6646 } 6550 6647 … … 6566 6663 title = {Tutorial: Programming Language Design}, 6567 6664 publisher = {Computer Society Press}, 6665 address = {Los Alamitos}, 6568 6666 year = 1980 6569 6667 } … … 6635 6733 % U 6636 6734 6637 @ unpublished{uC++book,6638 keywords = {control structure, concurrency },6735 @book{uC++book, 6736 keywords = {control structure, concurrency, uC++}, 6639 6737 contributer = {pabuhr@plg}, 6640 6738 author = {Peter A. Buhr}, 6641 title = {Understanding Control Flow with Concurrent Programming using $\mu${C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}}}, 6642 year = 1999, 6643 note = {Textbook in preparation} 6739 title = {Understanding Control Flow: Concurrent Programming using $\mu${C}{\kern-.1em\hbox{\large\texttt{+\kern-.25em+}}}}, 6740 publisher = {Springer}, 6741 address = {Switzerland}, 6742 year = 2016, 6644 6743 } 6645 6744 … … 6664 6763 booktitle = {Proceedings of the International Workshop on Memory Management}, 6665 6764 location = {St. Malo, France}, 6666 publisher = {Springer -Verlag},6765 publisher = {Springer}, 6667 6766 series = {Lecture Notes in Computer Science}, 6668 6767 volume = 637, … … 6788 6887 title = {VAX-11 Architecture Reference Manual}, 6789 6888 publisher = {Digital Press}, 6889 address = {Bedford}, 6790 6890 month = may, 6791 6891 year = 1982, … … 6796 6896 title = {{VAX/VMS} Internals and Data Structures Version 4.4}, 6797 6897 publisher = {Digital Press}, 6898 address = {Bedford}, 6798 6899 year = 1988, 6799 6900 } … … 6805 6906 title = {Verifying a Simplification of Mutual Exclusion by {L}ycklama--{H}adzilacos}, 6806 6907 journal = {Acta Informatica}, 6807 publisher = {Springer-Verlag}, 6908 publisher = {Springer}, 6909 address = {New York}, 6808 6910 year = {2013}, 6809 6911 volume = {50}, … … 6871 6973 month = jun, 6872 6974 year = 1985, 6873 note = {\ textsf{http://www.hpl.hp.com/\-techreports/\-tandem/\-TR-85.7.pdf}},6975 note = {\href{http://www.hpl.hp.com/techreports/tandem/TR-85.7.pdf}{http://www.hpl.hp.com/\-techreports/\-tandem/\-TR-85.7.pdf}}, 6874 6976 } 6875 6977 -
doc/proposals/concurrency/concurrency.tex
r141b786 rb726084 1 1 % requires tex packages: texlive-base texlive-latex-base tex-common texlive-humanities texlive-latex-extra texlive-fonts-recommended 2 2 3 % inline code ©...©(copyright symbol) emacs: C-q M-)4 % red highlighting ®...®(registered trademark symbol) emacs: C-q M-.5 % blue highlighting ß...ß(sharp s symbol) emacs: C-q M-_6 % green highlighting ¢...¢(cent symbol) emacs: C-q M-"7 % LaTex escape §...§(section symbol) emacs: C-q M-'8 % keyword escape ¶...¶(pilcrow symbol) emacs: C-q M-^3 % inline code �...� (copyright symbol) emacs: C-q M-) 4 % red highlighting �...� (registered trademark symbol) emacs: C-q M-. 5 % blue highlighting �...� (sharp s symbol) emacs: C-q M-_ 6 % green highlighting �...� (cent symbol) emacs: C-q M-" 7 % LaTex escape �...� (section symbol) emacs: C-q M-' 8 % keyword escape �...� (pilcrow symbol) emacs: C-q M-^ 9 9 % math escape $...$ (dollar symbol) 10 10 … … 14 14 15 15 % Latex packages used in the document. 16 \usepackage[T1]{fontenc} 16 \usepackage[T1]{fontenc} % allow Latin1 (extended ASCII) characters 17 17 \usepackage{textcomp} 18 18 \usepackage[latin1]{inputenc} 19 19 \usepackage{fullpage,times,comment} 20 20 \usepackage{epic,eepic} 21 \usepackage{upquote} 21 \usepackage{upquote} % switch curled `'" to straight 22 22 \usepackage{calc} 23 23 \usepackage{xspace} … … 25 25 \usepackage{tabularx} 26 26 \usepackage[acronym]{glossaries} 27 \usepackage{varioref} 27 \usepackage{varioref} % extended references 28 28 \usepackage{inconsolata} 29 \usepackage{listings} 30 \usepackage[flushmargin]{footmisc} 31 \usepackage{latexsym} 32 \usepackage{mathptmx} 29 \usepackage{listings} % format program code 30 \usepackage[flushmargin]{footmisc} % support label/reference in footnote 31 \usepackage{latexsym} % \Box glyph 32 \usepackage{mathptmx} % better math font with "times" 33 33 \usepackage[usenames]{color} 34 34 \usepackage[pagewise]{lineno} 35 35 \usepackage{fancyhdr} 36 36 \renewcommand{\linenumberfont}{\scriptsize\sffamily} 37 \input{ common}% bespoke macros used in the document37 \input{style} % bespoke macros used in the document 38 38 \usepackage[dvips,plainpages=false,pdfpagelabels,pdfpagemode=UseNone,colorlinks=true,pagebackref=true,linkcolor=blue,citecolor=blue,urlcolor=blue,pagebackref=true,breaklinks=true]{hyperref} 39 39 \usepackage{breakurl} … … 44 44 \renewcommand{\UrlFont}{\small\sf} 45 45 46 \setlength{\topmargin}{-0.45in} 46 \setlength{\topmargin}{-0.45in} % move running title into header 47 47 \setlength{\headsep}{0.25in} 48 48 … … 86 86 \title{Concurrency in \CFA} 87 87 \author{Thierry Delisle \\ 88 Dept.of Computer Science, University of Waterloo, \\ Waterloo, Ontario, Canada88 School of Computer Science, University of Waterloo, \\ Waterloo, Ontario, Canada 89 89 } 90 90 91 91 \maketitle 92 93 % ### # # ####### ###### ####### 94 % # ## # # # # # # 95 % # # # # # # # # # 96 % # # # # # ###### # # 97 % # # # # # # # # # 98 % # # ## # # # # # 99 % ### # # # # # ####### 100 92 101 \section{Introduction} 93 This proposal provides a minimal core concurrency API that is both simple, efficient and can be reused to build higher-level features. The simplest possible core is a thread and a lock but this low-level approach is hard to master. An easier approach for users is to support higher-level construct as the basis of the concurrency in \CFA. 94 Indeed, for highly productive parallel programming high-level approaches are much more popular\cite{HPP:Study}. Examples are task based parallelism, message passing, implicit threading. 95 96 There are actually two problems that need to be solved in the design of the concurrency for a language. Which concurrency tools are available to the users and which parallelism tools are available. While these two concepts are often seen together, they are in fact distinct concepts that require different sorts of tools\cite{Buhr05a}. Concurrency tools need to handle mutual exclusion and synchronization while parallelism tools are more about performance, cost and resource utilization. 102 This proposal provides a minimal core concurrency API that is both simple, efficient and can be reused to build higher-level features. The simplest possible concurrency core is a thread and a lock but this low-level approach is hard to master. An easier approach for users is to support higher-level constructs as the basis of the concurrency in \CFA. Indeed, for highly productive parallel programming, high-level approaches are much more popular~\cite{HPP:Study}. Examples are task based parallelism, message passing and implicit threading. 103 104 There are actually two problems that need to be solved in the design of the concurrency for a programming language. Which concurrency tools are available to the users and which parallelism tools are available. While these two concepts are often seen together, they are in fact distinct concepts that require different sorts of tools~\cite{Buhr05a}. Concurrency tools need to handle mutual exclusion and synchronization, while parallelism tools are more about performance, cost and resource utilization. 105 106 % ##### ####### # # ##### # # ###### ###### ####### # # ##### # # 107 % # # # # ## # # # # # # # # # # ## # # # # # 108 % # # # # # # # # # # # # # # # # # # # # 109 % # # # # # # # # # ###### ###### ##### # # # # # 110 % # # # # # # # # # # # # # # # # # # # 111 % # # # # # ## # # # # # # # # # # ## # # # 112 % ##### ####### # # ##### ##### # # # # ####### # # ##### # 97 113 98 114 \section{Concurrency} 99 Several tool can be used to solve concurrency challenges. Since these challenges always appear with the use of mutable shared state, some languages and libraries simply disallow mutable shared-state (Erlang\cite{Erlang}, Haskell\cite{Haskell}, Akka (Scala)\cite{Akka}). In these paradigms, interaction among concurrent objects rely on message passing or other paradigms that often closely relate to networking concepts. However, in imperative or OO languages, these approaches entail a clear distinction between concurrent and non-concurrent paradigms (i.e. message passing versus routine call). Which in turns mean that programmers need to learn two sets of designs patterns in order to be effective. Approaches based on shared memory are more closely related to non-concurrent paradigms since they often rely on non-concurrent constructs like routine calls and objects. At a lower level these can be implemented as locks and atomic operations. However, for productivity reasons it is desireable to have a higher-level construct to be the core concurrency paradigm\cite{HPP:Study}. This project proposes Monitors\cite{Hoare74} as the core concurrency construct. 100 \\ 101 102 Finally, an approach that is worth mentionning because it is gaining in popularity is transactionnal memory\cite{Dice10}. However, the performance and feature set is currently too restrictive to be possible to add such a paradigm to a language like C or \CC\cit, which is why it was rejected as the core paradigm for concurrency in \CFA. 115 Several tool can be used to solve concurrency challenges. Since these challenges always appear with the use of mutable shared state, some languages and libraries simply disallow mutable shared-state (Erlang~\cite{Erlang}, Haskell~\cite{Haskell}, Akka (Scala)~\cite{Akka}). In these paradigms, interaction among concurrent objects relies on message passing~\cite{Thoth,Harmony,V-Kernel} or other paradigms that closely relate to networking concepts. However, in languages that use routine calls as their core abstraction mechanism, these approaches force a clear distinction between concurrent and non-concurrent paradigms (i.e. message passing versus routine call). Which in turn means that, in order to be effective, programmers need to learn two sets of designs patterns. This distinction can be hidden away in library code, but effective use of the librairy will still have to take both paradigms into account. Approaches based on shared memory are more closely related to non-concurrent paradigms since they often rely on non-concurrent constructs like routine calls and objects. At a lower level these can be implemented as locks and atomic operations. Many such mechanisms have been proposed, including semaphores~\cite{Dijkstra68b} and path expressions~\cite{Campbell74}. However, for productivity reasons it is desireable to have a higher-level construct to be the core concurrency paradigm~\cite{HPP:Study}. An approach that is worth mentionning because it is gaining in popularity is transactionnal memory~\cite{Dice10}[Check citation]. While this approach is even pursued by system languages like \CC\cit, the performance and feature set is currently too restrictive to be possible to add such a paradigm to a language like C or \CC\cit, which is why it was rejected as the core paradigm for concurrency in \CFA. One of the most natural, elegant, and efficient mechanisms for synchronization and communication, especially for shared memory systems, is the \emph{monitor}. Monitors were first proposed by Brinch Hansen~\cite{Hansen73} and later described and extended by C.A.R.~Hoare~\cite{Hoare74}. Many programming languages---e.g., Concurrent Pascal~\cite{ConcurrentPascal}, Mesa~\cite{Mesa}, Modula~\cite{Modula-2}, Turing~\cite{Turing:old}, Modula-3~\cite{Modula-3}, NeWS~\cite{NeWS}, Emerald~\cite{Emerald}, \uC~\cite{Buhr92a} and Java~\cite{Java}---provide monitors as explicit language constructs. In addition, operating-system kernels and device drivers have a monitor-like structure, although they often use lower-level primitives such as semaphores or locks to simulate monitors. For these reasons, this project proposes Monitors as the core concurrency construct. 116 117 % # # ####### # # ### ####### ####### ###### ##### 118 % ## ## # # ## # # # # # # # # # 119 % # # # # # # # # # # # # # # # # 120 % # # # # # # # # # # # # ###### ##### 121 % # # # # # # # # # # # # # # 122 % # # # # # ## # # # # # # # # 123 % # # ####### # # ### # ####### # # ##### 103 124 104 125 \subsection{Monitors} 105 A monitor is a set of routines that ensure mutual exclusion when accessing shared state. This concept is generally associated with Object-Oriented Languages like Java \cite{Java} or \uC\cite{uC++book} but does not strictly require OOP semantics. The only requirements is the ability to declare a handle to a shared object and a set of routines that act on it :126 A monitor is a set of routines that ensure mutual exclusion when accessing shared state. This concept is generally associated with Object-Oriented Languages like Java~\cite{Java} or \uC~\cite{uC++book} but does not strictly require OOP semantics. The only requirements is the ability to declare a handle to a shared object and a set of routines that act on it : 106 127 \begin{lstlisting} 107 128 typedef /*some monitor type*/ monitor; … … 114 135 \end{lstlisting} 115 136 137 % ##### # # # 138 % # # # # # # 139 % # # # # # 140 % # # # # # 141 % # ####### # # 142 % # # # # # # 143 % ##### # # ####### ####### 144 116 145 \subsubsection{Call semantics} \label{call} 117 The above example of monitors already displays some of their intrinsic caracteristics. Indeed, it is necessary to use pass-by-reference over pass-by-value for monitor routines. This semantics is important because at their core, monitors are implicit mutual exclusion objects (locks), and these objects cannot be copied. Therefore, monitors are implicitly non-copyable. 118 \\ 119 120 Another aspect to consider is when a monitor acquires its mutual exclusion. Indeed, a monitor may need to be passed through multiple helper routines that do not acquire the monitor mutual exclusion on entry. Examples of this can be both generic helper routines (\code{swap}, \code{sort}, etc.) or specific helper routines like the following example : 146 The above monitor example displays some of their intrinsic characteristics. Indeed, it is necessary to use pass-by-reference over pass-by-value for monitor routines. This semantics is important because at their core, monitors are implicit mutual-exclusion objects (locks), and these objects cannot be copied. Therefore, monitors are implicitly non-copyable. 147 148 Another aspect to consider is when a monitor acquires its mutual exclusion. For example, a monitor may need to be passed through multiple helper routines that do not acquire the monitor mutual exclusion on entry. Pass through can be both generic helper routines (\code{swap}, \code{sort}, etc.) or specific helper routines like the following to implement an atomic large counter : 121 149 122 150 \begin{lstlisting} … … 124 152 125 153 void ?{}(counter_t & nomutex this); 126 int ++?(counter_t & mutex this); 127 void ?{}(Int * this, counter_t & mutex cnt); 154 size_t ++?(counter_t & mutex this); 155 156 //need for mutex is platform dependent here 157 void ?{}(size_t * this, counter_t & mutex cnt); 128 158 \end{lstlisting} 129 159 *semantics of the declaration of \code{mutex struct counter_t} are discussed in details in section \ref{data} 130 \\ 131 132 This example is of a monitor implementing an atomic counter. Here, the constructor uses the \code{nomutex} keyword to signify that it does not acquire the coroutine mutual exclusion when constructing. This is because object not yet constructed should never be shared and therefore do not require mutual exclusion. The prefix increment operator 133 uses \code{mutex} to protect the incrementing process from race conditions. Finally, we have a conversion operator from \code{counter_t} to \code{Int}. This conversion may or may not require the \code{mutex} key word depending whether or not reading an \code{Int} is an atomic operation or not. 134 \\ 135 136 Having both \code{mutex} and \code{nomutex} keywords could be argued to be redundant based on the meaning of a routine having neither of these keywords. If there were a meaning to routine \code{void foo(counter_t & this)} then one could argue that it should be to default to the safest option : \code{mutex}. On the other hand, the option of having routine \code{void foo(counter_t & this)} mean \code{nomutex} is unsafe by default and may easily cause subtle errors. It can be argued that this is the more "normal" behavior, \code{nomutex} effectively stating explicitly that "this routine has nothing special". An other alternative is to make one of these keywords mandatory, which would provide the same semantics but without the ambiguity of supporting routine \code{void foo(counter_t & this)}. Mandatory keywords would also have the added benefice of being more clearly self-documented but at the cost of extra typing. In the end, which solution should be picked is still up for debate. For the reminder of this proposal, the explicit approach will be used for the sake of clarity. 137 \\ 138 139 Regardless of which keyword is kept, it is important to establish when mutex/nomutex may be used depending on type parameters. 160 161 Here, the constructor(\code(?{})) uses the \code{nomutex} keyword to signify that it does not acquire the monitor mutual exclusion when constructing. This semantics is because object not yet constructed should never be shared and therefore do not require mutual exclusion. The prefix increment operator uses \code{mutex} to protect the incrementing process from race conditions. Finally, there is a conversion operator from \code{counter_t} to \code{size_t}. This conversion may or may not require the \code{mutex} key word depending on whether or not reading an \code{size_t} is an atomic operation or not. 162 163 Having both \code{mutex} and \code{nomutex} keywords could be argued to be redundant based on the meaning of a routine having neither of these keywords. If there were a meaning to routine \code{void foo(counter_t & this)} then one could argue that it should default to the safest option : \code{mutex}. On the other hand, the option of having routine \code{void foo(counter_t & this)} mean \code{nomutex} is unsafe by default and may easily cause subtle errors. It can be argued that this is the more "normal" behavior, \code{nomutex} effectively stating explicitly that "this routine has nothing special". Another alternative is to make having exactly one of these keywords mandatory, which would provide the same semantics but without the ambiguity of supporting routine \code{void foo(counter_t & this)}. Mandatory keywords would also have the added benefice of being self-documented but at the cost of extra typing. In the end, which solution should be picked is still up for debate. For the reminder of this proposal, the explicit approach is used for clarity. 164 165 Regardless of which keyword is kept, it is important to establish when mutex/nomutex may be used as a type qualifier. Consider : 140 166 \begin{lstlisting} 141 167 int f1(monitor & mutex m); … … 146 172 \end{lstlisting} 147 173 148 The problem is to indentify which object(s) should be acquired. Furthermore we also need to acquire each objects only once. In case of simple routines like \code{f1} and \code{f2} it is easy to identify an exhaustive list of objects to acquire on entering. Adding indirections (\code{f3}) still allows the compiler and programmer to indentify which object will be acquired. However, adding in arrays (\code{f4}) makes it much harder. Array lengths aren't necessarily known in C and even then making sure we only acquire objects once becomes also none trivial. This can be extended to absurd limits like \code{f5} which uses a custom graph of monitors. To keep everyone as sane as possible\cite{Chicken}, this projects imposes the requirement that a routine may only acquire one monitor per parameter and it must be the type of the parameter (ignoring potential qualifiers and indirections). 174 The problem is to indentify which object(s) should be acquired. Furthermore, each object needs to be acquired only once. In case of simple routines like \code{f1} and \code{f2} it is easy to identify an exhaustive list of objects to acquire on entering. Adding indirections (\code{f3}) still allows the compiler and programmer to indentify which object is acquired. However, adding in arrays (\code{f4}) makes it much harder. Array lengths are not necessarily known in C and even then making sure we only acquire objects once becomes also none trivial. This can be extended to absurd limits like \code{f5}, which uses a graph of monitors. To keep everyone as sane as possible~\cite{Chicken}, this projects imposes the requirement that a routine may only acquire one monitor per parameter and it must be the type of the parameter (ignoring potential qualifiers and indirections). Also note that while routine \code{f3} can be supported, meaning that monitor \code{**m} will be acquired, passing an array to this routine would be type safe and result in undefined behavior. For this reason, it would also be reasonnable to disallow mutex in the context where arrays may be passed. 175 176 % ###### # ####### # 177 % # # # # # # # 178 % # # # # # # # 179 % # # # # # # # 180 % # # ####### # ####### 181 % # # # # # # # 182 % ###### # # # # # 149 183 150 184 \subsubsection{Data semantics} \label{data} … … 160 194 161 195 int ++?(counter_t & mutex this) { 162 return ++this->value; 163 } 164 196 return ++this.value; 197 } 198 199 //need for mutex is platform dependent here 165 200 void ?{}(int * this, counter_t & mutex cnt) { 166 201 *this = (int)cnt; 167 202 } 168 203 \end{lstlisting} 169 \begin{tabular}{ c c } 170 Thread 1 & Thread 2 \\ 171 \begin{lstlisting} 172 void f(counter_t & mutex c) { 173 for(;;) { 174 sout | (int)c | endl; 175 } 176 } 177 \end{lstlisting} &\begin{lstlisting} 178 void g(counter_t & mutex c) { 179 for(;;) { 180 ++c; 181 } 182 } 183 204 205 This simple counter offers an example of monitor usage. Notice how the counter is used without any explicit synchronisation and yet supports thread-safe semantics for both reading and writting : 206 \begin{center} 207 \begin{tabular}{c @{\hskip 0.35in} c @{\hskip 0.35in} c} 208 \begin{lstlisting} 209 counter_t cnt; 210 211 thread 1 : cnt++; 212 thread 2 : cnt++; 213 thread 3 : cnt++; 214 ... 215 thread N : cnt++; 184 216 \end{lstlisting} 185 217 \end{tabular} 186 \\ 187 188 189 This simple counter offers an example of monitor usage. Notice how the counter is used without any explicit synchronisation and yet supports thread-safe semantics for both reading and writting. \\ 218 \end{center} 190 219 191 220 These simple mutual exclusion semantics also naturally expand to multi-monitor calls. … … 198 227 \end{lstlisting} 199 228 200 This code acquires both locks before entering the critical section . In practice, writing multi-locking routines that can not lead to deadlocks can be very tricky. Having language level support for such feature is therefore a significant asset for \CFA. However, this does have significant repercussions relating to scheduling (see \ref{insched} and \ref{extsched}). Furthermore, the ability to acquire multiple monitors at the same time does incur a significant pitfall even without looking into scheduling. For example:229 This code acquires both locks before entering the critical section (Referenced as \gls{group-acquire} from now on). In practice, writing multi-locking routines that can not lead to deadlocks can be tricky. Having language support for such a feature is therefore a significant asset for \CFA. In the case presented above, \CFA guarantees that the order of aquisition will be consistent across calls to routines using the same monitors as arguments. However, since \CFA monitors use multi-acquiring locks users can effectively force the acquiring order. For example, notice which routines use \code{mutex}/\code{nomutex} and how this affects aquiring order : 201 230 \begin{lstlisting} 202 231 void foo(A & mutex a, B & mutex a) { … … 217 246 \end{lstlisting} 218 247 219 Recursive mutex routine calls are allowed in \CFA but if not done carefully it can lead to nested monitor call problems\cite{Lister77}. These problems which are a specific implementation of the lock acquiring order problem. In the example above, the user uses implicit ordering in the case of function \code{bar} but explicit ordering in the case of \code{baz}. This subtle mistake can mean that calling these two functions concurrently will lead to deadlocks, depending on the implicit ordering matching the explicit ordering. As shown on several occasion\cit, there isn't really any solutions to this problem, users simply need to be carefull when acquiring multiple monitors at the same time. 248 Such a use will lead to nested monitor call problems~\cite{Lister77}, which are a specific implementation of the lock acquiring order problem. In the example above, the user uses implicit ordering in the case of function \code{foo} but explicit ordering in the case of \code{bar} and \code{baz}. This subtle mistake means that calling these routines concurrently may lead to deadlocks, depending on the implicit ordering matching the explicit ordering. As shown on several occasion\cit, solving this problems requires to : 249 \begin{enumerate} 250 \item Dynamically track the monitor call order. 251 \item Implement rollback semantics. 252 \end{enumerate} 253 254 While the first requirement is already a significant constraint on the system, implementing a general rollback semantics in a C-like language is prohibitively complex \cit. In \CFA users simply need to be carefull when acquiring multiple monitors at the same time. 255 256 % ###### ####### ####### # ### # ##### 257 % # # # # # # # # # # 258 % # # # # # # # # # 259 % # # ##### # # # # # ##### 260 % # # # # ####### # # # 261 % # # # # # # # # # # 262 % ###### ####### # # # ### ####### ##### 263 % 264 % ###### ####### # # # # # ####### ###### # # 265 % # # # # # # # ## ## # # # # # # 266 % # # # # # # # # # # # # # # # # # 267 % ##### ###### # # # # # # # # # ###### ####### 268 % # # # # # # # # # # # # # 269 % # # # # # # # # # # # # # 270 % # ####### ####### # # # ####### # # # # 220 271 221 272 \subsubsection{Implementation Details: Interaction with polymorphism} 222 At first glance, interaction between monitors and \CFA's concept of polymorphism seem complexe to support. However, it can be reasoned that entry-point locking can solve most of the issues that could be present with polymorphism. 223 224 First of all, interaction between \code{otype} polymorphism and monitors is impossible since monitors do not support copying. Therefore the main question is how to support \code{dtype} polymorphism. We must remember that monitors' main purpose is to ensure mutual exclusion when accessing shared data. This implies that mutual exclusion is only required for routines that do in fact access shared data. However, since \code{dtype} polymorphism always handle incomplete types (by definition) no \code{dtype} polymorphic routine can access shared data since the data would require knowledge about the type. Therefore the only concern when combining \code{dtype} polymorphism and monitors is to protect access to routines. With callsite-locking, this would require significant amount of work since any \code{dtype} routine could have to obtain some lock before calling a routine. However, with entry-point-locking calling a monitor routine becomes exactly the same as calling it from anywhere else. 273 At first glance, interaction between monitors and \CFA's concept of polymorphism seem complex to support. However, it can be reasoned that entry-point locking can solve most of the issues that could be present with polymorphism. 274 275 First of all, interaction between \code{otype} polymorphism and monitors is impossible since monitors do not support copying. Therefore, the main question is how to support \code{dtype} polymorphism. Since a monitor's main purpose is to ensure mutual exclusion when accessing shared data, this implies that mutual exclusion is only required for routines that do in fact access shared data. However, since \code{dtype} polymorphism always handles incomplete types (by definition), no \code{dtype} polymorphic routine can access shared data since the data requires knowledge about the type. Therefore the only concern when combining \code{dtype} polymorphism and monitors is to protect access to routines. \Gls{callsite-locking}\footnotemark would require a significant amount of work, since any \code{dtype} routine may have to obtain some lock before calling a routine, depending on whether or not the type passed is a monitor. However, with \gls{entry-point-locking}\footnotemark[\value{footnote}] calling a monitor routine becomes exactly the same as calling it from anywhere else. 276 \footnotetext{See glossary for a definition of \gls{callsite-locking} and \gls{entry-point-locking}} 277 278 % ### # # ####### ##### ##### # # ####### ###### 279 % # ## # # # # # # # # # # # 280 % # # # # # # # # # # # # 281 % # # # # # ##### # ####### ##### # # 282 % # # # # # ### # # # # # # # 283 % # # ## # ### # # # # # # # # # 284 % ### # # # ### ##### ##### # # ####### ###### 225 285 226 286 \subsection{Internal scheduling} \label{insched} 227 Monitors should also be able to schedule what threads access it as a mean of synchronization. Internal scheduling is one of the simple examples of such a feature. It allows users to declare condition variables and wait for them to be signaled. Here is a simple example of such a technique :287 Monitors also need to schedule waiting threads within it as a mean of synchronization. Internal scheduling is one of the simple examples of such a feature. It allows users to declare condition variables and have threads wait and signaled from them. Here is a simple example of such a technique : 228 288 229 289 \begin{lstlisting} … … 243 303 \end{lstlisting} 244 304 245 Here routine \code{foo} waits on the \code{signal} from \code{bar} before making further progress, effectively ensuring a basic ordering. This semantic can easily be extended to multi-monitor calls by offering the same guarantee. 246 305 Here routine \code{foo} waits for the \code{signal} from \code{bar} before making further progress, effectively ensuring a basic ordering. This semantic can easily be extended to multi-monitor calls by offering the same guarantee. 247 306 \begin{center} 248 307 \begin{tabular}{ c @{\hskip 0.65in} c } … … 250 309 \begin{lstlisting} 251 310 void foo(monitor & mutex a, 252 monitor & mutex b) {311 monitor & mutex b) { 253 312 //... 254 313 wait(a.e); … … 259 318 \end{lstlisting} &\begin{lstlisting} 260 319 void bar(monitor & mutex a, 261 monitor & mutex b) {320 monitor & mutex b) { 262 321 signal(a.e); 263 322 } … … 269 328 \end{tabular} 270 329 \end{center} 271 272 A direct extension of the single monitor semantics would be to release all locks when waiting and transferring ownership of all locks when signalling. However, for the purpose of synchronization it may be usefull to only release some of the locks but keep others. On the technical side, partially releasing lock is feasible but from the user perspective a choice must be made for the syntax of this feature. It is possible to do without any extra syntax by relying on order of acquisition (Note that here the use of helper routines is irrelevant, only routines the acquire mutual exclusion have an impact on internal scheduling): 330 A direct extension of the single monitor semantics is to release all locks when waiting and transferring ownership of all locks when signalling. However, for the purpose of synchronization it may be usefull to only release some of the locks but keep others. It is possible to support internal scheduling and \gls{group-acquire} without any extra syntax by relying on order of acquisition. Here is an example of the different contexts in which internal scheduling can be used. (Note that here the use of helper routines is irrelevant, only routines acquire mutual exclusion have an impact on internal scheduling): 273 331 274 332 \begin{center} … … 280 338 281 339 void foo(monitor & mutex a, 282 monitor & mutex b) { 340 monitor & mutex b) { 341 283 342 wait(e); 284 343 } … … 294 353 295 354 void bar(monitor & mutex a, 296 monitor & nomutex b) {355 monitor & nomutex b) { 297 356 foo(a,b); 298 357 } 299 358 300 359 void foo(monitor & mutex a, 301 monitor & mutex b) {360 monitor & mutex b) { 302 361 wait(e); 303 362 } … … 308 367 309 368 void bar(monitor & mutex a, 310 monitor & nomutex b) {311 foo(a,b);369 monitor & nomutex b) { 370 baz(a,b); 312 371 } 313 372 314 373 void baz(monitor & nomutex a, 315 monitor & mutex b) {374 monitor & mutex b) { 316 375 wait(e); 317 376 } … … 322 381 \end{center} 323 382 324 This can be interpreted in two different ways : 325 \begin{flushleft} 326 \begin{enumerate} 327 \item \code{wait} atomically releases the monitors acquired by the inner-most routine, \underline{ignoring} nested calls. 328 \item \code{wait} atomically releases the monitors acquired by the inner-most routine, \underline{considering} nested calls. 329 \end{enumerate} 330 \end{flushleft} 331 While the difference between these two is subtle, it has a significant impact. In the first case it means that the calls to \code{foo} would behave the same in Context 1 and 2. This semantic would also mean that the call to \code{wait} in routine \code{baz} would only release \code{monitor b}. While this may seem intuitive with these examples, it does have one significant implication, it creates a strong distinction between acquiring multiple monitors in sequence and acquiring the same monitors simulatenously, i.e. : 383 Note that in \CFA, \code{condition} have no particular need to be stored inside a monitor, beyond any software engineering reasons. Context 1 is the simplest way of acquiring more than one monitor (\gls{group-acquire}), using a routine wiht multiple parameters having the \code{mutex} keyword. Context 2 also uses \gls{group-acquire} as well in routine \code{foo}. However, the routine is called by routine \code{bar} which only acquires monitor \code{a}. Since monitors can be acquired multiple times this will not cause a deadlock by itself but it does force the acquiring order to \code{a} then \code{b}. Context 3 also forces the acquiring order to be \code{a} then \code{b} but does not use \gls{group-acquire}. The previous example tries to illustrate the semantics that must be established to support releasing monitors in a \code{wait} statement. In all cases the behavior of the wait statment is to release all the locks that were acquired my the inner-most monitor call. That is \code{a & b} in context 1 and 2 and \code{b} only in context 3. Here are a few other examples of this behavior. 384 332 385 333 386 \begin{center} 334 \begin{tabular}{c @{\hskip 0.35in} c @{\hskip 0.35in} c} 335 \begin{lstlisting} 336 enterMonitor(a); 337 enterMonitor(b); 338 // do stuff 339 leaveMonitor(b); 340 leaveMonitor(a); 341 \end{lstlisting} & != &\begin{lstlisting} 342 enterMonitor(a); 343 enterMonitor(a, b); 344 // do stuff 345 leaveMonitor(a, b); 346 leaveMonitor(a); 387 \begin{tabular}{|c|c|c|} 388 \begin{lstlisting} 389 condition e; 390 391 //acquire a 392 void foo(monitor & nomutex a, 393 monitor & mutex b) { 394 bar(a,b); 395 } 396 397 //acquire a 398 void bar(monitor & mutex a, 399 monitor & nomutex b) { 400 401 //release a 402 //keep b 403 wait(e); 404 } 405 406 foo(a, b); 407 \end{lstlisting} &\begin{lstlisting} 408 condition e; 409 410 //acquire a & b 411 void foo(monitor & mutex a, 412 monitor & mutex b) { 413 bar(a,b); 414 } 415 416 //acquire b 417 void bar(monitor & mutex a, 418 monitor & nomutex b) { 419 420 //release b 421 //keep a 422 wait(e); 423 } 424 425 foo(a, b); 426 \end{lstlisting} &\begin{lstlisting} 427 condition e; 428 429 //acquire a & b 430 void foo(monitor & mutex a, 431 monitor & mutex b) { 432 bar(a,b); 433 } 434 435 //acquire none 436 void bar(monitor & nomutex a, 437 monitor & nomutex b) { 438 439 //release a & b 440 //keep none 441 wait(e); 442 } 443 444 foo(a, b); 347 445 \end{lstlisting} 348 446 \end{tabular} 349 447 \end{center} 350 351 This is not intuitive because even if both methods display the same monitors state both inside and outside the critical section respectively, the behavior is different. Furthermore, the actual acquiring order will be exaclty the same since acquiring a monitor from inside its mutual exclusion is a no-op. This means that even if the data and the actual control flow are the same using both methods, the behavior of the \code{wait} will be different. The alternative is option 2, that is releasing acquired monitors, \underline{considering} nesting. This solves the issue of having the two acquiring method differ at the cost of making routine \code{foo} behave differently depending on from which context it is called (Context 1 or 2). Indeed in Context 2, routine \code{foo} actually behaves like routine \code{baz} rather than having the same behavior than in Context 1. The fact that both implicit approaches can be unintuitive depending on the perspective may be a sign that the explicit approach is superior. For this reason this \CFA does not support implicit monitor releasing and uses explicit semantics. 448 Note the right-most example which uses a helper routine and therefore is not relevant to find which monitors will be released. 449 450 These semantics imply that in order to release of subset of the monitors currently held, users must write (and name) a routine that only acquires the desired subset and simply calls wait. While users can use this method, \CFA offers the \code{wait_release}\footnote{Not sure if an overload of \code{wait} would work...} which will release only the specified monitors. 451 452 Regardless of the context in which the \code{wait} statement is used, \code{signal} must used holding the same set of monitors. In all cases, signal only needs a single parameter, the condition variable that needs to be signalled. But \code{signal} needs to be called from the same monitor(s) that call to \code{wait}. Otherwise, mutual exclusion cannot be properly transferred back to the waiting monitor. 453 454 Finally, an additional semantic which can be very usefull is the \code{signal_block} routine. This routine behaves like signal for all of the semantics discussed above, but with the subtelty that mutual exclusion is transferred to the waiting task immediately rather than wating for the end of the critical section. 352 455 \\ 353 456 354 The following examples shows three alternatives of explicit wait semantics : 355 \\ 356 357 \begin{center} 358 \begin{tabular}{|c|c|c|} 359 Case 1 & Case 2 & Case 3 \\ 360 Branding on construction & Explicit release list & Explicit ignore list \\ 361 \hline 362 \begin{lstlisting} 363 void foo(monitor & mutex a, 364 monitor & mutex b, 365 condition & c) 366 { 367 // Releases monitors 368 // branded in ctor 369 wait(c); 370 } 371 372 monitor a; 373 monitor b; 374 condition1 c1 = {a}; 375 condition2 c2 = {a, b}; 376 377 //Will release only a 378 foo(a,b,c1); 379 380 //Will release a and b 381 foo(a,b,c2); 382 \end{lstlisting} &\begin{lstlisting} 383 void foo(monitor & mutex a, 384 monitor & mutex b, 385 condition & c) 386 { 387 // Releases monitor a 388 // Holds monitor b 389 waitRelease(c, [a]); 390 } 391 392 monitor a; 393 monitor b; 394 condition c; 395 396 397 398 foo(a,b,c); 399 400 401 402 \end{lstlisting} &\begin{lstlisting} 403 void foo(monitor & mutex a, 404 monitor & mutex b, 405 condition & c) 406 { 407 // Releases monitor a 408 // Holds monitor b 409 waitHold(c, [b]); 410 } 411 412 monitor a; 413 monitor b; 414 condition c; 415 416 417 418 foo(a,b,c); 419 420 421 422 \end{lstlisting} 423 \end{tabular} 424 \end{center} 425 (Note : Case 2 and 3 use tuple semantics to pass a variable length list of elements.) 426 \\ 427 428 All these cases have their pros and cons. Case 1 is more distinct because it means programmers need to be carefull about where the condition is initialized as well as where it is used. On the other hand, it is very clear and explicitly states which monitor is released and which monitor stays acquired. This is similar to Case 2, which releases only the monitors explictly listed. However, in Case 2, calling the \code{wait} routine instead of the \code{waitRelease} routine releases all the acquired monitor. The Case 3 is an improvement on that since it releases all the monitors except those specified. The result is that the \code{wait} routine can be written as follows : 429 \begin{lstlisting} 430 void wait(condition & cond) { 431 waitHold(cond, []); 432 } 433 \end{lstlisting} 434 This alternative offers nice and consistent behavior between \code{wait} and \code{waitHold}. However, one large pitfall is that mutual exclusion can now be violated by calls to library code. Indeed, even if the following example seems benign there is one significant problem : 435 \begin{lstlisting} 436 monitor global; 437 438 extern void doStuff(); //uses global 439 440 void foo(monitor & mutex m) { 441 //... 442 doStuff(); //warning can release monitor m 443 //... 444 } 445 446 foo(global); 447 \end{lstlisting} 448 449 Indeed, if Case 2 or 3 are chosen it any code can violate the mutual exclusion of the calling code by issuing calls to \code{wait} or \code{waitHold} in a nested monitor context. Case 2 can be salvaged by removing the \code{wait} routine from the API but Case 3 cannot prevent users from calling \code{waitHold(someCondition, [])}. For this reason the syntax proposed in Case 3 is rejected. Note that the syntax proposed in case 1 and 2 are not exclusive. Indeed, by supporting two types of condition both cases can be supported : 450 \begin{lstlisting} 451 struct condition { /*...*/ }; 452 453 // Second argument is a variable length tuple. 454 void wait(condition & cond, [...] monitorsToRelease); 455 void signal(condition & cond); 456 457 struct conditionN { /*...*/ }; 458 459 void ?{}(conditionN* this, /*list of N monitors to release*/); 460 void wait(conditionN & cond); 461 void signal(conditionN & cond); 462 \end{lstlisting} 463 464 Regardless of the option chosen for wait semantics, signal must be symmetrical. In all cases, signal only needs a single parameter, the condition variable that needs to be signalled. But \code{signal} needs to be called from the same monitor(s) that call to \code{wait}. Otherwise, mutual exclusion cannot be properly transferred back to the waiting monitor. 465 466 Finally, an additionnal semantic which can be very usefull is the \code{signalBlock} routine. This routine behaves like signal for all of the semantics discussed above, but with the subtelty that mutual exclusion is transferred to the waiting task immediately rather than wating for the end of the critical section. 467 \\ 468 457 % ####### # # ####### ##### ##### # # ####### ###### 458 % # # # # # # # # # # # # # 459 % # # # # # # # # # # # 460 % ##### # # ##### # ####### ##### # # 461 % # # # # ### # # # # # # # 462 % # # # # ### # # # # # # # # # 463 % ####### # # # ### ##### ##### # # ####### ###### 464 \newpage 469 465 \subsection{External scheduling} \label{extsched} 470 466 As one might expect, the alternative to Internal scheduling is to use External scheduling instead. This method is somewhat more robust to deadlocks since one of the threads keeps a relatively tight control on scheduling. Indeed, as the following examples will demonstrate, external scheduling allows users to wait for events from other threads without the concern of unrelated events occuring. External scheduling can generally be done either in terms of control flow (ex: \uC) or in terms of data (ex: Go). Of course, both of these paradigms have their own strenghts and weaknesses but for this project control flow semantics where chosen to stay consistent with the rest of the languages semantics. Two challenges specific to \CFA arise when trying to add external scheduling with loose object definitions and multi-monitor routines. The following example shows what a simple use \code{accept} versus \code{wait}/\code{signal} and its advantages. … … 496 492 In the case of internal scheduling, the call to \code{wait} only guarantees that \code{g} was the last routine to access the monitor. This intails that the routine \code{f} may have acquired mutual exclusion several times while routine \code{h} was waiting. On the other hand, external scheduling guarantees that while routine \code{h} was waiting, no routine other than \code{g} could acquire the monitor. 497 493 \\ 494 495 % # ####### ####### ##### ####### ####### ###### # ##### 496 % # # # # # # # # # # # # # # # 497 % # # # # # # # # # # # # # 498 % # # # # # ##### ##### # # ###### # ##### 499 % # # # # # # # # # # # # # # 500 % # # # # # # # # # # # # # # # # 501 % ####### ####### ####### ##### ####### ####### ###### ##### ##### 498 502 499 503 \subsubsection{Loose object definitions} … … 587 591 An other aspect to consider is what happens if multiple overloads of the same routine are used. For the time being it is assumed that multiple overloads of the same routine should be scheduled regardless of the overload used. However, this could easily be extended in the future. 588 592 593 % # # # # # ####### ### # # ####### # # 594 % ## ## # # # # # ## ## # # ## # 595 % # # # # # # # # # # # # # # # # # # 596 % # # # # # # # # # # # # # # # # 597 % # # # # # # # # # # # # # # 598 % # # # # # # # # # # # # ## 599 % # # ##### ####### # ### # # ####### # # 600 589 601 \subsubsection{Multi-monitor scheduling} 590 602 … … 629 641 Note that the set of monitors passed to the \code{accept} statement must be entirely contained in the set of monitor already acquired in the routine. \code{accept} used in any other context is Undefined Behaviour. 630 642 643 % ###### ####### ####### # ### # ##### 644 % # # # # # # # # # # 645 % # # # # # # # # # 646 % # # ##### # # # # # ##### 647 % # # # # ####### # # # 648 % # # # # # # # # # # 649 % ###### ####### # # # ### ####### ##### 650 % 651 % ##### # # ####### # # ####### ##### 652 % # # # # # # # # # # 653 % # # # # # # # # # 654 % ##### # # # # ##### # # ##### ##### 655 % # # # # # # # # # # 656 % # # # # # # # # # # 657 % #### # ##### ####### ##### ####### ##### 658 659 631 660 \subsubsection{Implementation Details: External scheduling queues} 632 661 To support multi-monitor external scheduling means that some kind of entry-queues must be used that is aware of both monitors. However, acceptable routines must be aware of the entry queues which means they must be stored inside at least one of the monitors that will be acquired. This in turn adds the requirement a systematic algorithm of disambiguating which queue is relavant regardless of user ordering. The proposed algorithm is to fall back on monitors lock ordering and specify that the monitor that is acquired first is the lock with the relevant entry queue. This assumes that the lock acquiring order is static for the lifetime of all concerned objects but that is a reasonnable constraint. This algorithm choice has two consequences, the entry queue of the highest priority monitor is no longer a true FIFO queue and the queue of the lowest priority monitor is both required and probably unused. The queue can no longer be a FIFO queue because instead of simply containing the waiting threads in order arrival, they also contain the second mutex. Therefore, another thread with the same highest priority monitor but a different lowest priority monitor may arrive first but enter the critical section after a thread with the correct pairing. Secondly, since it may not be known at compile time which monitor will be the lowest priority monitor, every monitor needs to have the correct queues even though it is probable that half the multi-monitor queues will go unused for the entire duration of the program. … … 636 665 637 666 \newpage 667 % ###### # ###### # # # ####### # ### ##### # # 668 % # # # # # # # # # # # # # # # ## ## 669 % # # # # # # # # # # # # # # # # # # 670 % ###### # # ###### # # # # ##### # # ##### # # # 671 % # ####### # # ####### # # # # # # # # 672 % # # # # # # # # # # # # # # # # 673 % # # # # # # # ####### ####### ####### ####### ### ##### # # 638 674 \section{Parallelism} 639 Historically, computer performance was about processor speeds and instructions count. However, with heat dissipation being an ever growing challenge, parallelism has become the new source of greatest performance 675 Historically, computer performance was about processor speeds and instructions count. However, with heat dissipation being an ever growing challenge, parallelism has become the new source of greatest performance~\cite{Sutter05, Sutter05b}. In this decade, it is not longer reasonnable to create high-performance application without caring about parallelism. Indeed, parallelism is an important aspect of performance and more specifically throughput and hardware utilization. The lowest level approach of parallelism is to use \glspl{kthread}. However since these have significant costs and limitations \glspl{kthread} are now mostly used as an implementation tool rather than a user oriented one. There are several alternatives to solve these issues which all have strengths and weaknesses. 640 676 641 677 \subsection{User-level threads} 642 678 A direct improvement on the \gls{kthread} approach is to use \glspl{uthread}. These threads offer most of the same features that the operating system already provide but can be used on a much larger scale. This is the most powerfull solution as it allows all the features of multi-threading while removing several of the more expensives costs of using kernel threads. The down side is that almost none of the low-level threading complexities are hidden, users still have to think about data races, deadlocks and synchronization issues. This can be somewhat alleviated by a concurrency toolkit with strong garantees but the parallelism toolkit offers very little to reduce complexity in itself. 643 679 644 Examples of languages that support are Java \cite{Java}, Haskell\cite{Haskell} and \uC\cite{uC++book}.680 Examples of languages that support are Java~\cite{Java}, Haskell~\cite{Haskell} and \uC~\cite{uC++book}. 645 681 646 682 \subsection{Jobs and thread pools} 647 683 The approach on the opposite end of the spectrum is to base parallelism on \glspl{job}. Indeed, \glspl{job} offer limited flexibility but at the benefit of a simpler user interface. In \gls{job} based systems users express parallelism as units of work and the dependency graph (either explicit or implicit) that tie them together. This means users need not to worry about concurrency but significantly limits the interaction that can occur between different jobs. Indeed, any \gls{job} that blocks also blocks the underlying \gls{kthread}, this effectively mean the CPU utilization, and therefore throughput, will suffer noticeably. 648 The golden standard of this implementation is Intel's TBB library \cite{TBB}.684 The golden standard of this implementation is Intel's TBB library~\cite{TBB}. 649 685 650 686 \subsection{Fibers : user-level threads without preemption} 651 687 Finally, in the middle of the flexibility versus complexity spectrum lay \glspl{fiber} which offer \glspl{uthread} without the complexity of preemption. This means users don't have to worry about other \glspl{fiber} suddenly executing between two instructions which signficantly reduces complexity. However, any call to IO or other concurrency primitives can lead to context switches. Furthermore, users can also block \glspl{fiber} in the middle of their execution without blocking a full processor core. This means users still have to worry about mutual exclusion, deadlocks and race conditions in their code, raising the complexity significantly. 652 An example of a language that uses fibers is Go \cite{Go}688 An example of a language that uses fibers is Go~\cite{Go} 653 689 654 690 \subsection{Paradigm performance} 655 691 While the choice between the three paradigms listed above may have significant performance implication, it is difficult to pin the performance implications of chosing a model at the language level. Indeed, in many situations one of these paradigms will show better performance but it all strongly depends on the usage. Having mostly indepent units of work to execute almost guarantess that the \gls{job} based system will have the best performance. However, add interactions between jobs and the processor utilisation might suffer. User-level threads may allow maximum ressource utilisation but context switches will be more expansive and it is also harder for users to get perfect tunning. As with every example, fibers sit somewhat in the middle of the spectrum. Furthermore, if the units of uninterrupted work are large enough the paradigm choice will be largely amorticised by the actual work done. 692 693 % ##### ####### # ####### ###### ###### 694 % # # # # # # # # # # 695 % # # # # # # # # # 696 % # ##### # # ##### # ###### ###### 697 % # # ####### # # # # # 698 % # # # # # # # # # # 699 % ##### # # # # ###### ###### 656 700 657 701 \section{\CFA 's Thread Building Blocks} … … 673 717 As shown in section \ref{cfaparadigms} these different blocks being available in \CFA it is trivial to reproduce any of these paradigm. 674 718 719 % ####### # # ###### ####### # ###### ##### 720 % # # # # # # # # # # # # 721 % # # # # # # # # # # # 722 % # ####### ###### ##### # # # # ##### 723 % # # # # # # ####### # # # 724 % # # # # # # # # # # # # 725 % # # # # # ####### # # ###### ##### 726 675 727 \subsection{Thread Interface} 676 728 The basic building blocks of \CFA are \glspl{cfathread}. By default these are implemented as \glspl{uthread} and as such offer a flexible and lightweight threading interface (lightweight comparatievely to \glspl{kthread}). A thread can be declared using a struct declaration prefix with the \code{thread} as follows : … … 680 732 \end{lstlisting} 681 733 682 Obviously, for this thread implementation to be usefull it must run some user code. Several other threading interfaces use some function pointer representation as the interface of threads (for example : \Csharp \cite{Csharp} and Scala\cite{Scala}). However, we consider that statically tying a \code{main} routine to a thread superseeds this approach. Since the \code{main} routine is definetely a special routine in \CFA, we can reuse the existing syntax for declaring routines with unordinary name, i.e. operator overloading. As such the \code{main} routine of a thread can be defined as such :734 Obviously, for this thread implementation to be usefull it must run some user code. Several other threading interfaces use some function pointer representation as the interface of threads (for example : \Csharp~\cite{Csharp} and Scala~\cite{Scala}). However, we consider that statically tying a \code{main} routine to a thread superseeds this approach. Since the \code{main} routine is definetely a special routine in \CFA, we can reuse the existing syntax for declaring routines with unordinary name, i.e. operator overloading. As such the \code{main} routine of a thread can be defined as such : 683 735 \begin{lstlisting} 684 736 thread struct foo {}; … … 843 895 % \textbf{\large{Work in progress...}} Do wee need something beyond specifying the number of kernel threads? 844 896 897 % # # # 898 % # # # # 899 % # # # # 900 % # # # # 901 % ####### # # 902 % # # # # 903 % # # ####### ####### 845 904 \section{Putting it all together} 846 905 906 907 908 909 910 911 912 913 914 915 % ####### # # ####### # # ###### ####### 916 % # # # # # # # # # 917 % # # # # # # # # # 918 % ##### # # # # # ###### ##### 919 % # # # # # # # # # 920 % # # # # # # # # # 921 % # ##### # ##### # # ###### 847 922 \section{Future work} 848 923 Concurrency and parallelism is still a very active field that strongly benefits from hardware advances. As such certain features that aren't necessarily mature enough in their current state could become relevant in the lifetime of \CFA. 849 924 \subsection{Transactions} 850 925 926 % ####### # # ###### 927 % # ## # # # 928 % # # # # # # 929 % ##### # # # # # 930 % # # # # # # 931 % # # ## # # 932 % ####### # # ###### 851 933 \section*{Acknowledgements} 852 934 … … 857 939 \clearpage 858 940 \bibliographystyle{plain} 859 \bibliography{ pl,local}941 \bibliography{cw92,distSharedMem,lfp92,mlw92,parallel,parallelIO,partheory,pl,pldi92,ps,realtime,techreportsPAB,visual,local} 860 942 861 943 -
doc/proposals/concurrency/glossary.tex
r141b786 rb726084 1 1 \makeglossaries 2 3 \longnewglossaryentry{callsite-locking} 4 {name={callsite-locking}} 5 { 6 Locking done by the calling routine. With this technique, a routine calling a monitor routine will aquire the monitor \emph{before} making the call to the actuall routine. 7 } 8 9 \longnewglossaryentry{entry-point-locking} 10 {name={entry-point-locking}} 11 { 12 Locking done by the called routine. With this technique, a monitor routine called by another routine will aquire the monitor \emph{after} entering the routine body but prior to any other code. 13 } 14 15 \longnewglossaryentry{group-acquire} 16 {name={grouped acquiring}} 17 { 18 Implicitly acquiring several monitors when entering a monitor. 19 } 20 21 2 22 \longnewglossaryentry{uthread} 3 23 {name={user-level thread}} -
doc/proposals/concurrency/version
r141b786 rb726084 1 0. 4.951 0.5.146 -
src/ControlStruct/LabelFixer.h
r141b786 rb726084 26 26 namespace ControlStruct { 27 27 /// normalizes label definitions and generates multi-level exit labels 28 class LabelFixer : public Visitor {28 class LabelFixer final : public Visitor { 29 29 typedef Visitor Parent; 30 30 public: … … 33 33 std::map < Label, Statement * > *resolveJumps() throw ( SemanticError ); 34 34 35 using Visitor::visit; 36 35 37 // Declarations 36 virtual void visit( FunctionDecl *functionDecl ) ;38 virtual void visit( FunctionDecl *functionDecl ) override; 37 39 38 40 // Statements 39 41 void visit( Statement *stmt ); 40 42 41 virtual void visit( CompoundStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }42 virtual void visit( NullStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }43 virtual void visit( ExprStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }44 virtual void visit( IfStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }45 virtual void visit( WhileStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }46 virtual void visit( ForStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }47 virtual void visit( SwitchStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }48 virtual void visit( CaseStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }49 virtual void visit( ReturnStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }50 virtual void visit( TryStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }51 virtual void visit( CatchStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }52 virtual void visit( DeclStmt *stmt ) { visit( (Statement *)stmt ); return Parent::visit( stmt ); }53 virtual void visit( BranchStmt *branchStmt ) ;54 virtual void visit( UntypedExpr *untyped ) ;43 virtual void visit( CompoundStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); } 44 virtual void visit( NullStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); } 45 virtual void visit( ExprStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); } 46 virtual void visit( IfStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); } 47 virtual void visit( WhileStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); } 48 virtual void visit( ForStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); } 49 virtual void visit( SwitchStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); } 50 virtual void visit( CaseStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); } 51 virtual void visit( ReturnStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); } 52 virtual void visit( TryStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); } 53 virtual void visit( CatchStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); } 54 virtual void visit( DeclStmt *stmt ) override { visit( (Statement *)stmt ); return Parent::visit( stmt ); } 55 virtual void visit( BranchStmt *branchStmt ) override; 56 virtual void visit( UntypedExpr *untyped ) override; 55 57 56 58 Label setLabelsDef( std::list< Label > &, Statement *definition ); -
src/GenPoly/Box.cc
r141b786 rb726084 64 64 65 65 /// Adds layout-generation functions to polymorphic types 66 class LayoutFunctionBuilder : public DeclMutator {66 class LayoutFunctionBuilder final : public DeclMutator { 67 67 unsigned int functionNesting; // current level of nested functions 68 68 public: 69 69 LayoutFunctionBuilder() : functionNesting( 0 ) {} 70 70 71 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ); 72 virtual Declaration *mutate( StructDecl *structDecl ); 73 virtual Declaration *mutate( UnionDecl *unionDecl ); 71 using DeclMutator::mutate; 72 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override; 73 virtual Declaration *mutate( StructDecl *structDecl ) override; 74 virtual Declaration *mutate( UnionDecl *unionDecl ) override; 74 75 }; 75 76 76 77 /// Replaces polymorphic return types with out-parameters, replaces calls to polymorphic functions with adapter calls as needed, and adds appropriate type variables to the function call 77 class Pass1 : public PolyMutator {78 class Pass1 final : public PolyMutator { 78 79 public: 79 80 Pass1(); 80 virtual Expression *mutate( ApplicationExpr *appExpr ); 81 virtual Expression *mutate( AddressExpr *addrExpr ); 82 virtual Expression *mutate( UntypedExpr *expr ); 83 virtual DeclarationWithType* mutate( FunctionDecl *functionDecl ); 84 virtual TypeDecl *mutate( TypeDecl *typeDecl ); 85 virtual Expression *mutate( CommaExpr *commaExpr ); 86 virtual Expression *mutate( ConditionalExpr *condExpr ); 87 virtual Statement * mutate( ReturnStmt *returnStmt ); 88 virtual Type *mutate( PointerType *pointerType ); 89 virtual Type * mutate( FunctionType *functionType ); 90 91 virtual void doBeginScope(); 92 virtual void doEndScope(); 81 82 using PolyMutator::mutate; 83 virtual Expression *mutate( ApplicationExpr *appExpr ) override; 84 virtual Expression *mutate( AddressExpr *addrExpr ) override; 85 virtual Expression *mutate( UntypedExpr *expr ) override; 86 virtual DeclarationWithType* mutate( FunctionDecl *functionDecl ) override; 87 virtual TypeDecl *mutate( TypeDecl *typeDecl ) override; 88 virtual Expression *mutate( CommaExpr *commaExpr ) override; 89 virtual Expression *mutate( ConditionalExpr *condExpr ) override; 90 virtual Statement * mutate( ReturnStmt *returnStmt ) override; 91 virtual Type *mutate( PointerType *pointerType ) override; 92 virtual Type * mutate( FunctionType *functionType ) override; 93 94 virtual void doBeginScope() override; 95 virtual void doEndScope() override; 93 96 private: 94 97 /// Pass the extra type parameters from polymorphic generic arguments or return types into a function application … … 135 138 /// * Moves polymorphic returns in function types to pointer-type parameters 136 139 /// * adds type size and assertion parameters to parameter lists 137 class Pass2 : public PolyMutator {140 class Pass2 final : public PolyMutator { 138 141 public: 139 142 template< typename DeclClass > 140 143 DeclClass *handleDecl( DeclClass *decl, Type *type ); 141 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ); 142 virtual ObjectDecl *mutate( ObjectDecl *objectDecl ); 143 virtual TypeDecl *mutate( TypeDecl *typeDecl ); 144 virtual TypedefDecl *mutate( TypedefDecl *typedefDecl ); 145 virtual Type *mutate( PointerType *pointerType ); 146 virtual Type *mutate( FunctionType *funcType ); 144 145 using PolyMutator::mutate; 146 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override; 147 virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override; 148 virtual TypeDecl *mutate( TypeDecl *typeDecl ) override; 149 virtual TypedefDecl *mutate( TypedefDecl *typedefDecl ) override; 150 virtual Type *mutate( PointerType *pointerType ) override; 151 virtual Type *mutate( FunctionType *funcType ) override; 147 152 148 153 private: … … 156 161 /// * Calculates polymorphic offsetof expressions from offset array 157 162 /// * Inserts dynamic calculation of polymorphic type layouts where needed 158 class PolyGenericCalculator : public PolyMutator {163 class PolyGenericCalculator final : public PolyMutator { 159 164 public: 160 165 typedef PolyMutator Parent; … … 163 168 template< typename DeclClass > 164 169 DeclClass *handleDecl( DeclClass *decl, Type *type ); 165 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) ;166 virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) ;167 virtual TypedefDecl *mutate( TypedefDecl *objectDecl ) ;168 virtual TypeDecl *mutate( TypeDecl *objectDecl ) ;169 virtual Statement *mutate( DeclStmt *declStmt ) ;170 virtual Type *mutate( PointerType *pointerType ) ;171 virtual Type *mutate( FunctionType *funcType ) ;172 virtual Expression *mutate( MemberExpr *memberExpr ) ;173 virtual Expression *mutate( SizeofExpr *sizeofExpr ) ;174 virtual Expression *mutate( AlignofExpr *alignofExpr ) ;175 virtual Expression *mutate( OffsetofExpr *offsetofExpr ) ;176 virtual Expression *mutate( OffsetPackExpr *offsetPackExpr ) ;177 178 virtual void doBeginScope() ;179 virtual void doEndScope() ;170 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override; 171 virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override; 172 virtual TypedefDecl *mutate( TypedefDecl *objectDecl ) override; 173 virtual TypeDecl *mutate( TypeDecl *objectDecl ) override; 174 virtual Statement *mutate( DeclStmt *declStmt ) override; 175 virtual Type *mutate( PointerType *pointerType ) override; 176 virtual Type *mutate( FunctionType *funcType ) override; 177 virtual Expression *mutate( MemberExpr *memberExpr ) override; 178 virtual Expression *mutate( SizeofExpr *sizeofExpr ) override; 179 virtual Expression *mutate( AlignofExpr *alignofExpr ) override; 180 virtual Expression *mutate( OffsetofExpr *offsetofExpr ) override; 181 virtual Expression *mutate( OffsetPackExpr *offsetPackExpr ) override; 182 183 virtual void doBeginScope() override; 184 virtual void doEndScope() override; 180 185 181 186 private: … … 197 202 198 203 /// Replaces initialization of polymorphic values with alloca, declaration of dtype/ftype with appropriate void expression, and sizeof expressions of polymorphic types with the proper variable 199 class Pass3 : public PolyMutator {204 class Pass3 final : public PolyMutator { 200 205 public: 201 206 template< typename DeclClass > 202 207 DeclClass *handleDecl( DeclClass *decl, Type *type ); 203 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ); 204 virtual ObjectDecl *mutate( ObjectDecl *objectDecl ); 205 virtual TypedefDecl *mutate( TypedefDecl *objectDecl ); 206 virtual TypeDecl *mutate( TypeDecl *objectDecl ); 207 virtual Type *mutate( PointerType *pointerType ); 208 virtual Type *mutate( FunctionType *funcType ); 208 209 using PolyMutator::mutate; 210 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override; 211 virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override; 212 virtual TypedefDecl *mutate( TypedefDecl *objectDecl ) override; 213 virtual TypeDecl *mutate( TypeDecl *objectDecl ) override; 214 virtual Type *mutate( PointerType *pointerType ) override; 215 virtual Type *mutate( FunctionType *funcType ) override; 209 216 private: 210 217 }; -
src/GenPoly/InstantiateGeneric.cc
r141b786 rb726084 147 147 148 148 /// Mutator pass that replaces concrete instantiations of generic types with actual struct declarations, scoped appropriately 149 class GenericInstantiator : public DeclMutator {149 class GenericInstantiator final : public DeclMutator { 150 150 /// Map of (generic type, parameter list) pairs to concrete type instantiations 151 151 InstantiationMap< AggregateDecl, AggregateDecl > instantiations; … … 158 158 GenericInstantiator() : DeclMutator(), instantiations(), dtypeStatics(), typeNamer("_conc_") {} 159 159 160 virtual Type* mutate( StructInstType *inst ); 161 virtual Type* mutate( UnionInstType *inst ); 162 163 virtual void doBeginScope(); 164 virtual void doEndScope(); 160 using DeclMutator::mutate; 161 virtual Type* mutate( StructInstType *inst ) override; 162 virtual Type* mutate( UnionInstType *inst ) override; 163 164 virtual void doBeginScope() override; 165 virtual void doEndScope() override; 165 166 private: 166 167 /// Wrap instantiation lookup for structs -
src/GenPoly/Specialize.cc
r141b786 rb726084 36 36 const std::list<Label> noLabels; 37 37 38 class Specialize : public PolyMutator {38 class Specialize final : public PolyMutator { 39 39 public: 40 40 Specialize( std::string paramPrefix = "_p" ); 41 41 42 virtual Expression * mutate( ApplicationExpr *applicationExpr ); 43 virtual Expression * mutate( AddressExpr *castExpr ); 44 virtual Expression * mutate( CastExpr *castExpr ); 42 using PolyMutator::mutate; 43 virtual Expression * mutate( ApplicationExpr *applicationExpr ) override; 44 virtual Expression * mutate( AddressExpr *castExpr ) override; 45 virtual Expression * mutate( CastExpr *castExpr ) override; 45 46 // virtual Expression * mutate( LogicalExpr *logicalExpr ); 46 47 // virtual Expression * mutate( ConditionalExpr *conditionalExpr ); -
src/InitTweak/FixInit.cc
r141b786 rb726084 49 49 namespace InitTweak { 50 50 namespace { 51 class InsertImplicitCalls : public GenPoly::PolyMutator {51 class InsertImplicitCalls final : public GenPoly::PolyMutator { 52 52 public: 53 53 /// wrap function application expressions as ImplicitCopyCtorExpr nodes so that it is easy to identify which … … 55 55 static void insert( std::list< Declaration * > & translationUnit ); 56 56 57 virtual Expression * mutate( ApplicationExpr * appExpr ); 57 using GenPoly::PolyMutator::mutate; 58 virtual Expression * mutate( ApplicationExpr * appExpr ) override; 58 59 }; 59 60 60 class ResolveCopyCtors : public SymTab::Indexer {61 class ResolveCopyCtors final : public SymTab::Indexer { 61 62 public: 62 63 /// generate temporary ObjectDecls for each argument and return value of each ImplicitCopyCtorExpr, … … 68 69 using Parent::visit; 69 70 70 virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ) ;71 virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ) override; 71 72 virtual void visit( UniqueExpr * unqExpr ); 72 73 … … 88 89 using Parent::visit; 89 90 typedef std::set< ObjectDecl * > ObjectSet; 90 virtual void visit( CompoundStmt *compoundStmt ) ;91 virtual void visit( DeclStmt *stmt ) ;91 virtual void visit( CompoundStmt *compoundStmt ) override; 92 virtual void visit( DeclStmt *stmt ) override; 92 93 protected: 93 94 ObjectSet curVars; … … 109 110 } 110 111 111 class LabelFinder : public ObjDeclCollector {112 class LabelFinder final : public ObjDeclCollector { 112 113 public: 113 114 typedef ObjDeclCollector Parent; … … 123 124 // subclasses are added, there is only one place that the code has to be updated, rather than ensure that 124 125 // every specialized class knows about every new kind of statement that might be added. 125 virtual void visit( CompoundStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 126 virtual void visit( ExprStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 127 virtual void visit( AsmStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 128 virtual void visit( IfStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 129 virtual void visit( WhileStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 130 virtual void visit( ForStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 131 virtual void visit( SwitchStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 132 virtual void visit( CaseStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 133 virtual void visit( BranchStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 134 virtual void visit( ReturnStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 135 virtual void visit( TryStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 136 virtual void visit( CatchStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 137 virtual void visit( FinallyStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 138 virtual void visit( NullStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 139 virtual void visit( DeclStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 140 virtual void visit( ImplicitCtorDtorStmt *stmt ) { handleStmt( stmt ); return Parent::visit( stmt ); } 126 using Parent::visit; 127 virtual void visit( CompoundStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 128 virtual void visit( ExprStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 129 virtual void visit( AsmStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 130 virtual void visit( IfStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 131 virtual void visit( WhileStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 132 virtual void visit( ForStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 133 virtual void visit( SwitchStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 134 virtual void visit( CaseStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 135 virtual void visit( BranchStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 136 virtual void visit( ReturnStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 137 virtual void visit( TryStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 138 virtual void visit( CatchStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 139 virtual void visit( FinallyStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 140 virtual void visit( NullStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 141 virtual void visit( DeclStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 142 virtual void visit( ImplicitCtorDtorStmt *stmt ) override { handleStmt( stmt ); return Parent::visit( stmt ); } 141 143 }; 142 144 143 class InsertDtors : public ObjDeclCollector {145 class InsertDtors final : public ObjDeclCollector { 144 146 public: 145 147 /// insert destructor calls at the appropriate places. must happen before CtorInit nodes are removed … … 153 155 InsertDtors( LabelFinder & finder ) : labelVars( finder.vars ) {} 154 156 155 virtual void visit( ObjectDecl * objDecl ); 156 157 virtual void visit( CompoundStmt * compoundStmt ); 158 virtual void visit( ReturnStmt * returnStmt ); 159 virtual void visit( BranchStmt * stmt ); 157 using Parent::visit; 158 159 virtual void visit( ObjectDecl * objDecl ) override; 160 161 virtual void visit( CompoundStmt * compoundStmt ) override; 162 virtual void visit( ReturnStmt * returnStmt ) override; 163 virtual void visit( BranchStmt * stmt ) override; 160 164 private: 161 165 void handleGoto( BranchStmt * stmt ); … … 165 169 }; 166 170 167 class FixInit : public GenPoly::PolyMutator {171 class FixInit final : public GenPoly::PolyMutator { 168 172 public: 169 173 /// expand each object declaration to use its constructor after it is declared. 170 174 static void fixInitializers( std::list< Declaration * > &translationUnit ); 171 175 172 virtual DeclarationWithType * mutate( ObjectDecl *objDecl ); 176 using GenPoly::PolyMutator::mutate; 177 virtual DeclarationWithType * mutate( ObjectDecl *objDecl ) override; 173 178 174 179 std::list< Declaration * > staticDtorDecls; 175 180 }; 176 181 177 class FixCopyCtors : public GenPoly::PolyMutator {182 class FixCopyCtors final : public GenPoly::PolyMutator { 178 183 public: 179 184 /// expand ImplicitCopyCtorExpr nodes into the temporary declarations, copy constructors, call expression, … … 181 186 static void fixCopyCtors( std::list< Declaration * > &translationUnit ); 182 187 183 virtual Expression * mutate( ImplicitCopyCtorExpr * impCpCtorExpr ); 184 virtual Expression * mutate( UniqueExpr * unqExpr ); 188 using GenPoly::PolyMutator::mutate; 189 virtual Expression * mutate( ImplicitCopyCtorExpr * impCpCtorExpr ) override; 190 virtual Expression * mutate( UniqueExpr * unqExpr ) override; 185 191 }; 186 192 187 class GenStructMemberCalls : public SymTab::Indexer {193 class GenStructMemberCalls final : public SymTab::Indexer { 188 194 public: 189 195 typedef Indexer Parent; … … 193 199 static void generate( std::list< Declaration * > & translationUnit ); 194 200 195 virtual void visit( FunctionDecl * funcDecl ); 196 197 virtual void visit( MemberExpr * memberExpr ); 198 virtual void visit( ApplicationExpr * appExpr ); 201 using Parent::visit; 202 203 virtual void visit( FunctionDecl * funcDecl ) override; 204 205 virtual void visit( MemberExpr * memberExpr ) override; 206 virtual void visit( ApplicationExpr * appExpr ) override; 199 207 200 208 SemanticError errors; … … 214 222 // resolve UntypedExprs that are found within newly 215 223 // generated constructor/destructor calls 216 class MutatingResolver : public Mutator {224 class MutatingResolver final : public Mutator { 217 225 public: 218 226 MutatingResolver( SymTab::Indexer & indexer ) : indexer( indexer ) {} 219 227 220 virtual DeclarationWithType* mutate( ObjectDecl *objectDecl ); 221 222 virtual Expression* mutate( UntypedExpr *untypedExpr ); 223 private: 228 using Mutator::mutate; 229 virtual DeclarationWithType* mutate( ObjectDecl *objectDecl ) override; 230 virtual Expression* mutate( UntypedExpr *untypedExpr ) override; 231 232 private: 224 233 SymTab::Indexer & indexer; 225 234 }; 226 235 227 class FixCtorExprs : public GenPoly::DeclMutator {236 class FixCtorExprs final : public GenPoly::DeclMutator { 228 237 public: 229 238 /// expands ConstructorExpr nodes into comma expressions, using a temporary for the first argument 230 239 static void fix( std::list< Declaration * > & translationUnit ); 231 240 232 virtual Expression * mutate( ConstructorExpr * ctorExpr ); 241 using GenPoly::DeclMutator::mutate; 242 virtual Expression * mutate( ConstructorExpr * ctorExpr ) override; 233 243 }; 234 244 } // namespace -
src/InitTweak/GenInit.cc
r141b786 rb726084 37 37 } 38 38 39 class ReturnFixer : public GenPoly::PolyMutator {39 class ReturnFixer final : public GenPoly::PolyMutator { 40 40 public: 41 41 /// consistently allocates a temporary variable for the return value … … 46 46 ReturnFixer(); 47 47 48 virtual DeclarationWithType * mutate( FunctionDecl *functionDecl );49 50 virtual Statement * mutate( ReturnStmt * returnStmt ) ;48 using GenPoly::PolyMutator::mutate; 49 virtual DeclarationWithType * mutate( FunctionDecl *functionDecl ) override; 50 virtual Statement * mutate( ReturnStmt * returnStmt ) override; 51 51 52 52 protected: … … 56 56 }; 57 57 58 class CtorDtor : public GenPoly::PolyMutator {58 class CtorDtor final : public GenPoly::PolyMutator { 59 59 public: 60 60 typedef GenPoly::PolyMutator Parent; … … 66 66 static void generateCtorDtor( std::list< Declaration * > &translationUnit ); 67 67 68 virtual DeclarationWithType * mutate( ObjectDecl * ) ;69 virtual DeclarationWithType * mutate( FunctionDecl *functionDecl ) ;68 virtual DeclarationWithType * mutate( ObjectDecl * ) override; 69 virtual DeclarationWithType * mutate( FunctionDecl *functionDecl ) override; 70 70 // should not traverse into any of these declarations to find objects 71 71 // that need to be constructed or destructed 72 virtual Declaration* mutate( StructDecl *aggregateDecl ) ;73 virtual Declaration* mutate( UnionDecl *aggregateDecl ) { return aggregateDecl; }74 virtual Declaration* mutate( EnumDecl *aggregateDecl ) { return aggregateDecl; }75 virtual Declaration* mutate( TraitDecl *aggregateDecl ) { return aggregateDecl; }76 virtual TypeDecl* mutate( TypeDecl *typeDecl ) { return typeDecl; }77 virtual Declaration* mutate( TypedefDecl *typeDecl ) { return typeDecl; }78 79 virtual Type * mutate( FunctionType *funcType ) { return funcType; }80 81 virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) ;72 virtual Declaration* mutate( StructDecl *aggregateDecl ) override; 73 virtual Declaration* mutate( UnionDecl *aggregateDecl ) override { return aggregateDecl; } 74 virtual Declaration* mutate( EnumDecl *aggregateDecl ) override { return aggregateDecl; } 75 virtual Declaration* mutate( TraitDecl *aggregateDecl ) override { return aggregateDecl; } 76 virtual TypeDecl* mutate( TypeDecl *typeDecl ) override { return typeDecl; } 77 virtual Declaration* mutate( TypedefDecl *typeDecl ) override { return typeDecl; } 78 79 virtual Type * mutate( FunctionType *funcType ) override { return funcType; } 80 81 virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) override; 82 82 83 83 private: … … 93 93 }; 94 94 95 class HoistArrayDimension : public GenPoly::DeclMutator {95 class HoistArrayDimension final : public GenPoly::DeclMutator { 96 96 public: 97 97 typedef GenPoly::DeclMutator Parent; … … 103 103 104 104 private: 105 virtual DeclarationWithType * mutate( ObjectDecl * objectDecl ); 106 virtual DeclarationWithType * mutate( FunctionDecl *functionDecl ); 105 using Parent::mutate; 106 107 virtual DeclarationWithType * mutate( ObjectDecl * objectDecl ) override; 108 virtual DeclarationWithType * mutate( FunctionDecl *functionDecl ) override; 107 109 // should not traverse into any of these declarations to find objects 108 110 // that need to be constructed or destructed 109 virtual Declaration* mutate( StructDecl *aggregateDecl ) { return aggregateDecl; }110 virtual Declaration* mutate( UnionDecl *aggregateDecl ) { return aggregateDecl; }111 virtual Declaration* mutate( EnumDecl *aggregateDecl ) { return aggregateDecl; }112 virtual Declaration* mutate( TraitDecl *aggregateDecl ) { return aggregateDecl; }113 virtual TypeDecl* mutate( TypeDecl *typeDecl ) { return typeDecl; }114 virtual Declaration* mutate( TypedefDecl *typeDecl ) { return typeDecl; }115 116 virtual Type* mutate( FunctionType *funcType ) { return funcType; }111 virtual Declaration* mutate( StructDecl *aggregateDecl ) override { return aggregateDecl; } 112 virtual Declaration* mutate( UnionDecl *aggregateDecl ) override { return aggregateDecl; } 113 virtual Declaration* mutate( EnumDecl *aggregateDecl ) override { return aggregateDecl; } 114 virtual Declaration* mutate( TraitDecl *aggregateDecl ) override { return aggregateDecl; } 115 virtual TypeDecl* mutate( TypeDecl *typeDecl ) override { return typeDecl; } 116 virtual Declaration* mutate( TypedefDecl *typeDecl ) override { return typeDecl; } 117 118 virtual Type* mutate( FunctionType *funcType ) override { return funcType; } 117 119 118 120 void hoist( Type * type ); -
src/InitTweak/InitTweak.h
r141b786 rb726084 100 100 101 101 class ExpanderImpl; 102 typedef std::list< Expression * > IndexList; 102 103 private: 103 104 std::shared_ptr< ExpanderImpl > expander; … … 105 106 106 107 // invariant: list of size 2N (elements come in pairs [index, dimension]) 107 typedef std::list< Expression * > IndexList;108 108 IndexList indices; 109 109 }; -
src/Makefile.am
r141b786 rb726084 6 6 ## file "LICENCE" distributed with Cforall. 7 7 ## 8 ## Makefile.am -- 8 ## Makefile.am -- 9 9 ## 10 10 ## Author : Peter A. Buhr 11 11 ## Created On : Sun May 31 08:51:46 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Sat Sep 24 15:03:52201614 ## Update Count : 7 313 ## Last Modified On : Thu Oct 27 20:41:25 2016 14 ## Update Count : 75 15 15 ############################################################################### 16 16 … … 41 41 driver_cfa_cpp_SOURCES = ${SRC} 42 42 driver_cfa_cpp_LDADD = ${LEXLIB} -ldl # yywrap 43 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -rdynamic -I${abs_top_srcdir}/src/include 43 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -I${abs_top_srcdir}/src/include -DYY_NO_INPUT 44 driver_cfa_cpp_LDFLAGS = -Xlinker -export-dynamic 44 45 45 46 MAINTAINERCLEANFILES += ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}} -
src/Makefile.in
r141b786 rb726084 198 198 driver_cfa_cpp_DEPENDENCIES = $(am__DEPENDENCIES_1) 199 199 driver_cfa_cpp_LINK = $(CXXLD) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) \ 200 $( AM_LDFLAGS) $(LDFLAGS) -o $@200 $(driver_cfa_cpp_LDFLAGS) $(LDFLAGS) -o $@ 201 201 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) 202 202 depcomp = $(SHELL) $(top_srcdir)/automake/depcomp … … 267 267 CFA_PREFIX = @CFA_PREFIX@ 268 268 CFLAGS = @CFLAGS@ 269 CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@270 269 CPP = @CPP@ 271 270 CPPFLAGS = @CPPFLAGS@ … … 419 418 driver_cfa_cpp_SOURCES = ${SRC} 420 419 driver_cfa_cpp_LDADD = ${LEXLIB} -ldl # yywrap 421 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -rdynamic -I${abs_top_srcdir}/src/include 420 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -DDEBUG_ALL -I${abs_top_srcdir}/src/include -DYY_NO_INPUT 421 driver_cfa_cpp_LDFLAGS = -Xlinker -export-dynamic 422 422 all: $(BUILT_SOURCES) 423 423 $(MAKE) $(AM_MAKEFLAGS) all-am -
src/Parser/ParseNode.h
r141b786 rb726084 109 109 ExpressionNode * set_extension( bool exten ) { extension = exten; return this; } 110 110 111 v oid print( std::ostream &os, int indent = 0 ) const{}111 virtual void print( std::ostream &os, int indent = 0 ) const override {} 112 112 void printOneLine( std::ostream &os, int indent = 0 ) const {} 113 113 … … 191 191 //############################################################################## 192 192 193 classTypeData;193 struct TypeData; 194 194 195 195 class DeclarationNode : public ParseNode { … … 275 275 } 276 276 277 v oid print( std::ostream &os, int indent = 0 ) const;278 v oid printList( std::ostream &os, int indent = 0 ) const;277 virtual void print( std::ostream &os, int indent = 0 ) const override; 278 virtual void printList( std::ostream &os, int indent = 0 ) const override; 279 279 280 280 Declaration * build() const; … … 349 349 virtual StatementNode * append_last_case( StatementNode * ); 350 350 351 virtual void print( std::ostream &os, int indent = 0 ) {}352 virtual void printList( std::ostream &os, int indent = 0 ) {}351 virtual void print( std::ostream &os, int indent = 0 ) const override {} 352 virtual void printList( std::ostream &os, int indent = 0 ) const override {} 353 353 private: 354 354 std::unique_ptr<Statement> stmt; -
src/ResolvExpr/AlternativeFinder.h
r141b786 rb726084 95 95 Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env ); 96 96 97 void resolveObject( const SymTab::Indexer & indexer, ObjectDecl * objectDecl );98 99 97 template< typename InputIterator, typename OutputIterator > 100 98 void findMinCost( InputIterator begin, InputIterator end, OutputIterator out ) { -
src/ResolvExpr/AlternativePrinter.h
r141b786 rb726084 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // AlternativePrinter.h -- 7 // AlternativePrinter.h -- 8 8 // 9 9 // Author : Richard C. Bilson … … 23 23 24 24 namespace ResolvExpr { 25 class AlternativePrinter : public SymTab::Indexer {25 class AlternativePrinter final : public SymTab::Indexer { 26 26 public: 27 27 AlternativePrinter( std::ostream &os ); 28 virtual void visit( ExprStmt *exprStmt ); 28 29 using SymTab::Indexer::visit; 30 virtual void visit( ExprStmt *exprStmt ) override; 29 31 private: 30 32 std::ostream &os; -
src/ResolvExpr/Resolver.cc
r141b786 rb726084 33 33 34 34 namespace ResolvExpr { 35 class Resolver : public SymTab::Indexer {35 class Resolver final : public SymTab::Indexer { 36 36 public: 37 37 Resolver() : SymTab::Indexer( false ) {} 38 Resolver( const SymTab::Indexer & indexer ) : SymTab::Indexer( indexer ) {} 39 40 virtual void visit( FunctionDecl *functionDecl ) ;41 virtual void visit( ObjectDecl * objectDecl );42 virtual void visit( TypeDecl *typeDecl ) ;43 virtual void visit( EnumDecl * enumDecl ) ;44 45 virtual void visit( ArrayType * at ) ;46 virtual void visit( PointerType * at ) ;47 48 virtual void visit( ExprStmt *exprStmt ) ;49 virtual void visit( AsmExpr *asmExpr ) ;50 virtual void visit( AsmStmt *asmStmt ) ;51 virtual void visit( IfStmt *ifStmt ) ;52 virtual void visit( WhileStmt *whileStmt ) ;53 virtual void visit( ForStmt *forStmt ) ;54 virtual void visit( SwitchStmt *switchStmt ) ;55 virtual void visit( CaseStmt *caseStmt ) ;56 virtual void visit( BranchStmt *branchStmt ) ;57 virtual void visit( ReturnStmt *returnStmt ) ;58 59 virtual void visit( SingleInit *singleInit ) ;60 virtual void visit( ListInit *listInit ) ;61 virtual void visit( ConstructorInit *ctorInit ) ;38 39 using SymTab::Indexer::visit; 40 virtual void visit( FunctionDecl *functionDecl ) override; 41 virtual void visit( ObjectDecl *functionDecl ) override; 42 virtual void visit( TypeDecl *typeDecl ) override; 43 virtual void visit( EnumDecl * enumDecl ) override; 44 45 virtual void visit( ArrayType * at ) override; 46 virtual void visit( PointerType * at ) override; 47 48 virtual void visit( ExprStmt *exprStmt ) override; 49 virtual void visit( AsmExpr *asmExpr ) override; 50 virtual void visit( AsmStmt *asmStmt ) override; 51 virtual void visit( IfStmt *ifStmt ) override; 52 virtual void visit( WhileStmt *whileStmt ) override; 53 virtual void visit( ForStmt *forStmt ) override; 54 virtual void visit( SwitchStmt *switchStmt ) override; 55 virtual void visit( CaseStmt *caseStmt ) override; 56 virtual void visit( BranchStmt *branchStmt ) override; 57 virtual void visit( ReturnStmt *returnStmt ) override; 58 59 virtual void visit( SingleInit *singleInit ) override; 60 virtual void visit( ListInit *listInit ) override; 61 virtual void visit( ConstructorInit *ctorInit ) override; 62 62 private: 63 63 typedef std::list< Initializer * >::iterator InitIterator; … … 69 69 void resolveSingleAggrInit( Declaration *, InitIterator &, InitIterator & ); 70 70 void fallbackInit( ConstructorInit * ctorInit ); 71 71 72 Type * functionReturn = nullptr; 72 73 Type *initContext = nullptr; … … 533 534 } 534 535 535 void resolveObject( const SymTab::Indexer & indexer, ObjectDecl * objectDecl ) {536 Resolver resolver( indexer );537 objectDecl->accept( resolver );538 }539 540 536 void Resolver::visit( ConstructorInit *ctorInit ) { 541 537 // xxx - fallback init has been removed => remove fallbackInit function and remove complexity from FixInit and remove C-init from ConstructorInit -
src/ResolvExpr/TypeMap.h
r141b786 rb726084 38 38 typedef typename std::map< std::string, Value* > ValueMap; 39 39 typedef typename ValueMap::iterator ValueMapIterator; 40 40 41 41 Value *voidValue; ///< Value for void type 42 42 Value *basicValue[BasicType::NUMBER_OF_BASIC_TYPES]; ///< Values for basic types … … 54 54 /// One scope of map rollbacks 55 55 typedef std::vector< std::pair< ValueMapIterator, Value* > > MapScope; 56 56 57 57 PointerScope pointers; ///< Value pointers to roll back to their previous state 58 58 MapScope mapNodes; ///< Value map iterators to roll back to their previous state … … 68 68 69 69 std::vector< Rollback > scopes; ///< Scope rollback information 70 70 71 71 struct Lookup : public Visitor { 72 72 Lookup( TypeMap<Value> &typeMap ) : typeMap( typeMap ), found( 0 ), toInsert( 0 ) {} … … 87 87 return found; 88 88 } 89 89 90 90 void findAndReplace( Value *&loc ) { 91 91 found = loc; … … 109 109 } 110 110 } 111 111 112 112 virtual void visit( VoidType *voidType ) { 113 113 findAndReplace( typeMap.voidValue ); 114 114 } 115 115 116 116 virtual void visit( BasicType *basicType ) { 117 117 findAndReplace( typeMap.basicValue[basicType->get_kind()] ); 118 118 } 119 119 120 120 virtual void visit( PointerType *pointerType ) { 121 121 // NOTE This is one of the places where the apporoximation of the resolver is (deliberately) poor; … … 129 129 } 130 130 } 131 131 132 132 virtual void visit( ArrayType *arrayType ) { 133 133 if ( dynamic_cast< FunctionType* >( arrayType->get_base() ) ) { … … 137 137 } 138 138 } 139 139 140 140 virtual void visit( FunctionType *functionType ) { 141 141 findAndReplace( typeMap.functionPointerValue ); 142 142 } 143 143 144 144 virtual void visit( StructInstType *structType ) { 145 145 findAndReplace( typeMap.structValue, structType->get_name() ); 146 146 } 147 147 148 148 virtual void visit( UnionInstType *unionType ) { 149 149 findAndReplace( typeMap.unionValue, unionType->get_name() ); 150 150 } 151 151 152 152 virtual void visit( EnumInstType *enumType ) { 153 153 findAndReplace( typeMap.enumValue, enumType->get_name() ); … … 157 157 Value *found; ///< Value found (NULL if none yet) 158 158 Value *toInsert; ///< Value to insert (NULL if a lookup) 159 }; // classLookup160 friend classLookup;161 159 }; // struct Lookup 160 friend struct Lookup; 161 162 162 public: 163 163 /// Starts a new scope … … 180 180 scopes.pop_back(); 181 181 } 182 182 183 183 TypeMap() : voidValue( 0 ), pointerValue( 0 ), voidPointerValue( 0 ), functionPointerValue( 0 ), structValue(), unionValue(), enumValue(), scopes() { 184 184 beginScope(); … … 199 199 return searcher.find( key ); 200 200 } 201 201 202 202 }; // class TypeMap 203 203 -
src/ResolvExpr/Unify.cc
r141b786 rb726084 73 73 const OpenVarSet &openVars; 74 74 WidenMode widenMode; 75 Type *commonType;76 75 const SymTab::Indexer &indexer; 77 76 }; -
src/SymTab/Validate.cc
r141b786 rb726084 94 94 95 95 /// Associates forward declarations of aggregates with their definitions 96 class Pass2 : public Indexer {96 class Pass2 final : public Indexer { 97 97 typedef Indexer Parent; 98 98 public: 99 99 Pass2( bool doDebug, const Indexer *indexer ); 100 100 private: 101 virtual void visit( StructInstType *structInst ); 102 virtual void visit( UnionInstType *unionInst ); 103 virtual void visit( TraitInstType *contextInst ); 104 virtual void visit( StructDecl *structDecl ); 105 virtual void visit( UnionDecl *unionDecl ); 106 virtual void visit( TypeInstType *typeInst ); 101 using Indexer::visit; 102 void visit( StructInstType *structInst ) final; 103 void visit( UnionInstType *unionInst ) final; 104 void visit( TraitInstType *contextInst ) final; 105 void visit( StructDecl *structDecl ) final; 106 void visit( UnionDecl *unionDecl ) final; 107 void visit( TypeInstType *typeInst ) final; 107 108 108 109 const Indexer *indexer; … … 182 183 }; 183 184 184 class CompoundLiteral : public GenPoly::DeclMutator {185 class CompoundLiteral final : public GenPoly::DeclMutator { 185 186 DeclarationNode::StorageClass storageclass = DeclarationNode::NoStorageClass; 186 187 187 virtual DeclarationWithType * mutate( ObjectDecl *objectDecl ); 188 virtual Expression *mutate( CompoundLiteralExpr *compLitExpr ); 188 using GenPoly::DeclMutator::mutate; 189 DeclarationWithType * mutate( ObjectDecl *objectDecl ) final; 190 Expression *mutate( CompoundLiteralExpr *compLitExpr ) final; 189 191 }; 190 192 … … 652 654 void EliminateTypedef::addImplicitTypedef( AggDecl * aggDecl ) { 653 655 if ( typedefNames.count( aggDecl->get_name() ) == 0 ) { 654 Type *type ;656 Type *type = nullptr; 655 657 if ( StructDecl * newDeclStructDecl = dynamic_cast< StructDecl * >( aggDecl ) ) { 656 658 type = new StructInstType( Type::Qualifiers(), newDeclStructDecl->get_name() ); -
src/driver/Makefile.am
r141b786 rb726084 11 11 ## Created On : Sun May 31 08:49:31 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Thu Jan 28 09:04:40201614 ## Update Count : 713 ## Last Modified On : Fri Oct 28 13:46:06 2016 14 ## Update Count : 10 15 15 ############################################################################### 16 16 … … 26 26 cc1_SOURCES = cc1.cc 27 27 28 cfa.cc : ${abs_top_srcdir}/version29 @true30 31 28 MAINTAINERCLEANFILES = @CFA_PREFIX@/bin/${bin_PROGRAMS} @CFA_PREFIX@/lib/${cc1lib_PROGRAMS} -
src/driver/Makefile.in
r141b786 rb726084 100 100 CFA_PREFIX = @CFA_PREFIX@ 101 101 CFLAGS = @CFLAGS@ 102 CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@103 102 CPP = @CPP@ 104 103 CPPFLAGS = @CPPFLAGS@ … … 543 542 544 543 545 cfa.cc : ${abs_top_srcdir}/version546 @true547 548 544 # Tell versions [3.59,3.63) of GNU make to not export all variables. 549 545 # Otherwise a system limit (for SysV at least) may be exceeded. -
src/driver/cfa.cc
r141b786 rb726084 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Oct 25 21:29:48201613 // Update Count : 15 212 // Last Modified On : Thu Oct 27 22:19:37 2016 13 // Update Count : 154 14 14 // 15 15 … … 50 50 51 51 52 #define str(s) #s 53 52 54 int main( int argc, char *argv[] ) { 53 string Version( CFA_VERSION_LONG ); 54 string Major( to_string( CFA_VERSION_MAJOR ) ), Minor( to_string( CFA_VERSION_MINOR ) ), Patch( to_string( CFA_VERSION_PATCH ) );55 string Version( CFA_VERSION_LONG ); // current version number from CONFIG 56 string Major( str( CFA_VERSION_MAJOR ) ), Minor( str( CFA_VERSION_MINOR ) ), Patch( str( CFA_VERSION_PATCH ) ); 55 57 56 58 string installincdir( CFA_INCDIR ); // fixed location of include files -
src/examples/Makefile.in
r141b786 rb726084 111 111 # applies to both programs 112 112 CFLAGS = -g -Wall -Wno-unused-function # TEMPORARY: does not build with -O2 113 CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@114 113 CPP = @CPP@ 115 114 CPPFLAGS = @CPPFLAGS@ -
src/libcfa/Makefile.in
r141b786 rb726084 137 137 CFA_PREFIX = @CFA_PREFIX@ 138 138 CFLAGS = -quiet -no-include-stdhdr -g -Wall -Wno-unused-function @CFA_FLAGS@ -B${abs_top_srcdir}/src/driver -XCFA -t # TEMPORARY: does not build with -O2 139 CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@140 139 CPP = @CPP@ 141 140 CPPFLAGS = @CPPFLAGS@ -
src/main.cc
r141b786 rb726084 10 10 // Created On : Fri May 15 23:12:02 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 29 17:34:39201613 // Update Count : 4 2612 // Last Modified On : Sun Oct 30 10:11:38 2016 13 // Update Count : 435 14 14 // 15 15 … … 18 18 #include <signal.h> // signal 19 19 #include <getopt.h> // getopt 20 #include <execinfo.h> // backtrace, backtrace_symbols _fd20 #include <execinfo.h> // backtrace, backtrace_symbols 21 21 #include <cxxabi.h> // __cxa_demangle 22 #include <cstring> // index 22 23 23 24 using namespace std; … … 76 77 static void dump( list< Declaration * > & translationUnit, ostream & out = cout ); 77 78 78 void backtrace( int start ) {// skip first N stack frames79 static void backtrace( int start ) { // skip first N stack frames 79 80 enum { Frames = 50 }; 80 81 void * array[Frames]; 81 int size = backtrace( array, Frames ); 82 char ** messages = backtrace_symbols( array, size ); 82 int size = ::backtrace( array, Frames ); 83 char ** messages = ::backtrace_symbols( array, size ); // does not demangle names 84 85 *index( messages[0], '(' ) = '\0'; // find executable name 86 cerr << "Stack back trace for: " << messages[0] << endl; 83 87 84 88 // skip last 2 stack frames after main … … 86 90 char * mangled_name = nullptr, * offset_begin = nullptr, * offset_end = nullptr; 87 91 for ( char *p = messages[i]; *p; ++p ) { // find parantheses and +offset 88 if ( *p == '(') {92 if ( *p == '(' ) { 89 93 mangled_name = p; 90 } else if ( *p == '+') {94 } else if ( *p == '+' ) { 91 95 offset_begin = p; 92 } else if ( *p == ')') {96 } else if ( *p == ')' ) { 93 97 offset_end = p; 94 98 break; … … 99 103 int frameNo = i - start; 100 104 if ( mangled_name && offset_begin && offset_end && mangled_name < offset_begin ) { 101 *mangled_name++ = '\0'; 105 *mangled_name++ = '\0'; // delimit strings 102 106 *offset_begin++ = '\0'; 103 107 *offset_end++ = '\0'; 104 108 105 int status , frameNo = i - start;109 int status; 106 110 char * real_name = __cxxabiv1::__cxa_demangle( mangled_name, 0, 0, &status ); 111 // bug in __cxa_demangle for single-character lower-case non-mangled names 107 112 if ( status == 0 ) { // demangling successful ? 108 113 cerr << "(" << frameNo << ") " << messages[i] << " : " 109 114 << real_name << "+" << offset_begin << offset_end << endl; 110 111 115 } else { // otherwise, output mangled name 112 116 cerr << "(" << frameNo << ") " << messages[i] << " : " 113 << mangled_name << " +" << offset_begin << offset_end << endl;117 << mangled_name << "(/*unknown*/)+" << offset_begin << offset_end << endl; 114 118 } // if 119 115 120 free( real_name ); 116 121 } else { // otherwise, print the whole line … … 125 130 cerr << "*CFA runtime error* program cfa-cpp terminated with " 126 131 << (sig_num == SIGSEGV ? "segment fault" : "bus error") 127 << " backtrace:" << endl;132 << "." << endl; 128 133 backtrace( 2 ); // skip first 2 stack frames 129 134 exit( EXIT_FAILURE ); -
src/tests/Makefile.in
r141b786 rb726084 121 121 # applies to both programs 122 122 CFLAGS = -g -Wall -Wno-unused-function @CFA_FLAGS@ # TEMPORARY: does not build with -O2 123 CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@124 123 CPP = @CPP@ 125 124 CPPFLAGS = @CPPFLAGS@
Note: See TracChangeset
for help on using the changeset viewer.