Changes in / [b8e3941:fb19194]
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/concurrency/Paper.tex
rb8e3941 rfb19194 292 292 293 293 \CFA~\cite{Moss18,Cforall} is a modern, polymorphic, non-object-oriented\footnote{ 294 \CFA has object-oriented features, such as constructors, destructors, and simple trait/interface inheritance.294 \CFA has object-oriented features, such as constructors, destructors, virtuals and simple trait/interface inheritance. 295 295 % Go interfaces, Rust traits, Swift Protocols, Haskell Type Classes and Java Interfaces. 296 296 % "Trait inheritance" works for me. "Interface inheritance" might also be a good choice, and distinguish clearly from implementation inheritance. 297 % You'll want to be a little bit careful with terms like "structural" and "nominal" inheritance as well. CFA has structural inheritance (I think Go as well) -- it's inferred based on the structure of the code. 298 % Java, Rust, and Haskell (not sure about Swift) have nominal inheritance, where there needs to be a specific statement that "this type inherits from this type". 299 However, functions \emph{cannot} be nested in structures and there is no mechanism to designate a function parameter as a receiver, \lstinline@this@, parameter.}, 297 % You'll want to be a little bit careful with terms like "structural" and "nominal" inheritance as well. CFA has structural inheritance (I think Go as well) -- it's inferred based on the structure of the code. Java, Rust, and Haskell (not sure about Swift) have nominal inheritance, where there needs to be a specific statement that "this type inherits from this type". 298 However, functions \emph{cannot} be nested in structures, so there is no lexical binding between a structure and set of functions implemented by an implicit \lstinline@this@ (receiver) parameter.}, 300 299 backwards-compatible extension of the C programming language. 301 300 In many ways, \CFA is to C as Scala~\cite{Scala} is to Java, providing a vehicle for new typing and control-flow capabilities on top of a highly popular programming language\footnote{ … … 318 317 Coroutines are only a stepping stone towards concurrency where the commonality is that coroutines and threads retain state between calls. 319 318 320 \Celeven and\CCeleven define concurrency~\cite[\S~7.26]{C11}, but it is largely wrappers for a subset of the pthreads library~\cite{Pthreads}.\footnote{Pthreads concurrency is based on simple thread fork and join in a function and mutex or condition locks, which is low-level and error-prone}319 \Celeven/\CCeleven define concurrency~\cite[\S~7.26]{C11}, but it is largely wrappers for a subset of the pthreads library~\cite{Pthreads}.\footnote{Pthreads concurrency is based on simple thread fork and join in a function and mutex or condition locks, which is low-level and error-prone} 321 320 Interestingly, almost a decade after the \Celeven standard, the most recent versions of gcc, clang, and msvc do not support the \Celeven include @threads.h@, indicating no interest in the C11 concurrency approach (possibly because of the recent effort to add concurrency to \CC). 322 321 While the \Celeven standard does not state a threading model, the historical association with pthreads suggests implementations would adopt kernel-level threading (1:1)~\cite{ThreadModel}, as for \CC. … … 393 392 \label{s:FundamentalExecutionProperties} 394 393 395 The features in a programming language should be composed ofa set of fundamental properties rather than an ad hoc collection chosen by the designers.394 The features in a programming language should be composed from a set of fundamental properties rather than an ad hoc collection chosen by the designers. 396 395 To this end, the control-flow features created for \CFA are based on the fundamental properties of any language with function-stack control-flow (see also \uC~\cite[pp.~140-142]{uC++}). 397 The fundamental properties are execution state, thread, and mutual-exclusion/synchronization .396 The fundamental properties are execution state, thread, and mutual-exclusion/synchronization (MES). 398 397 These independent properties can be used to compose different language features, forming a compositional hierarchy, where the combination of all three is the most advanced feature, called a thread. 399 398 While it is possible for a language to only provide threads for composing programs~\cite{Hermes90}, this unnecessarily complicates and makes inefficient solutions to certain classes of problems. 400 399 As is shown, each of the non-rejected composed language features solves a particular set of problems, and hence, has a defensible position in a programming language. 401 If a compositional feature is missing, a programmer has too few fundamental properties resulting in a complex and/or i nefficient solution.400 If a compositional feature is missing, a programmer has too few fundamental properties resulting in a complex and/or is inefficient solution. 402 401 403 402 In detail, the fundamental properties are: 404 403 \begin{description}[leftmargin=\parindent,topsep=3pt,parsep=0pt] 405 404 \item[\newterm{execution state}:] 406 is the state information needed by a control-flow feature to initialize and manage both compute data and execution location(s), and de-initialize. 407 For example, calling a function initializes a stack frame including contained objects with constructors, manages local data in blocks and return locations during calls, and de-initializes the frame by running any object destructors and management operations. 405 is the state information needed by a control-flow feature to initialize, manage compute data and execution location(s), and de-initialize, \eg calling a function initializes a stack frame including contained objects with constructors, manages local data in blocks and return locations during calls, and de-initializes the frame by running any object destructors and management operations. 408 406 State is retained in fixed-sized aggregate structures (objects) and dynamic-sized stack(s), often allocated in the heap(s) managed by the runtime system. 409 407 The lifetime of state varies with the control-flow feature, where longer life-time and dynamic size provide greater power but also increase usage complexity and cost. … … 416 414 Multiple threads provide \emph{concurrent execution}; 417 415 concurrent execution becomes parallel when run on multiple processing units, \eg hyper-threading, cores, or sockets. 418 A programmer needs mechanisms to create, block and unblock, and join with a thread, even if these basic mechanisms are supplied indirectly through high-level features.419 420 \item[\newterm{ mutual-exclusion / synchronization (MES)}:]421 is the concurrency mechanism to perform an action without interruption and establish timing relationships among multiple threads.416 There must be language mechanisms to create, block and unblock, and join with a thread, even if the mechanism is indirect. 417 418 \item[\newterm{MES}:] 419 is the concurrency mechanisms to perform an action without interruption and establish timing relationships among multiple threads. 422 420 We contented these two properties are independent, \ie mutual exclusion cannot provide synchronization and vice versa without introducing additional threads~\cite[\S~4]{Buhr05a}. 423 Limiting MES functionalityresults in contrived solutions and inefficiency on multi-core von Neumann computers where shared memory is a foundational aspect of its design.421 Limiting MES, \eg no access to shared data, results in contrived solutions and inefficiency on multi-core von Neumann computers where shared memory is a foundational aspect of its design. 424 422 \end{description} 425 These properties are fundamental as they cannot be built from existing language features, \eg a basic programming language like C99~\cite{C99} cannot create new control-flow features, concurrency, or provide MES without (atomic)hardware mechanisms.423 These properties are fundamental because they cannot be built from existing language features, \eg a basic programming language like C99~\cite{C99} cannot create new control-flow features, concurrency, or provide MES without atomic hardware mechanisms. 426 424 427 425 … … 445 443 \renewcommand{\arraystretch}{1.25} 446 444 %\setlength{\tabcolsep}{5pt} 447 \vspace*{-5pt}448 445 \begin{tabular}{c|c||l|l} 449 446 \multicolumn{2}{c||}{execution properties} & \multicolumn{2}{c}{mutual exclusion / synchronization} \\ … … 464 461 Yes (stackful) & Yes & \textbf{11}\ \ \ @thread@ & \textbf{12}\ \ @mutex@ @thread@ \\ 465 462 \end{tabular} 466 \vspace*{-8pt}467 463 \end{table} 468 464 … … 472 468 A @mutex@ structure, often called a \newterm{monitor}, provides a high-level interface for race-free access of shared data in concurrent programming-languages. 473 469 Case 3 is case 1 where the structure can implicitly retain execution state and access functions use this execution state to resume/suspend across \emph{callers}, but resume/suspend does not retain a function's local state. 474 A stackless structure, often called a \newterm{generator} or \emph{iterator}, is \newterm{stackless} because it still borrow sthe caller's stack and thread, but the stack is used only to preserve state across its callees not callers.470 A stackless structure, often called a \newterm{generator} or \emph{iterator}, is \newterm{stackless} because it still borrow the caller's stack and thread, but the stack is used only to preserve state across its callees not callers. 475 471 Generators provide the first step toward directly solving problems like finite-state machines that retain data and execution state between calls, whereas normal functions restart on each call. 476 472 Case 4 is cases 2 and 3 with thread safety during execution of the generator's access functions. … … 479 475 A stackful generator, often called a \newterm{coroutine}, is \newterm{stackful} because resume/suspend now context switch to/from the caller's and coroutine's stack. 480 476 A coroutine extends the state retained between calls beyond the generator's structure to arbitrary call depth in the access functions. 481 Cases 7 , 8, 9 and 10are rejected because a new thread must have its own stack, where the thread begins and stack frames are stored for calls, \ie it is unrealistic for a thread to borrow a stack.482 For cases 9 and 10, the stackless frame is not growable, precluding accepting nested calls, making calls, blocking as it requires calls, or preemption as it requires pushing an interrupt frame, all of which compound to require an unknown amount of execution state.483 Hence, if this kind of uninterruptablethread exists, it must execute to completion, \ie computation only, which severely restricts runtime management.477 Cases 7 and 8 are rejected because a new thread must have its own stack, where the thread begins and stack frames are stored for calls, \ie it is unrealistic for a thread to borrow a stack. 478 Cases 9 and 10 are rejected because a thread needs a growable stack to accept calls, make calls, block, or be preempted, all of which compound to require an unknown amount of execution state. 479 If this kind of thread exists, it must execute to completion, \ie computation only, which severely restricts runtime management. 484 480 Cases 11 and 12 are a stackful thread with and without safe access to shared state. 485 481 A thread is the language mechanism to start another thread of control in a program with growable execution state for call/return execution. … … 1400 1396 The call to @start@ is the first @resume@ of @prod@, which remembers the program main as the starter and creates @prod@'s stack with a frame for @prod@'s coroutine main at the top, and context switches to it. 1401 1397 @prod@'s coroutine main starts, creates local-state variables that are retained between coroutine activations, and executes $N$ iterations, each generating two random values, calling the consumer's @deliver@ function to transfer the values, and printing the status returned from the consumer. 1402 The producer 'scall to @delivery@ transfers values into the consumer's communication variables, resumes the consumer, and returns the consumer status.1398 The producer call to @delivery@ transfers values into the consumer's communication variables, resumes the consumer, and returns the consumer status. 1403 1399 Similarly on the first resume, @cons@'s stack is created and initialized, holding local-state variables retained between subsequent activations of the coroutine. 1404 1400 The symmetric coroutine cycle forms when the consumer calls the producer's @payment@ function, which resumes the producer in the consumer's delivery function. 1405 1401 When the producer calls @delivery@ again, it resumes the consumer in the @payment@ function. 1406 Both interface function s then return totheir corresponding coroutine-main functions for the next cycle.1402 Both interface function than return to the their corresponding coroutine-main functions for the next cycle. 1407 1403 Figure~\ref{f:ProdConsRuntimeStacks} shows the runtime stacks of the program main, and the coroutine mains for @prod@ and @cons@ during the cycling. 1408 1404 As a consequence of a coroutine retaining its last resumer for suspending back, these reverse pointers allow @suspend@ to cycle \emph{backwards} around a symmetric coroutine cycle. … … 1418 1414 1419 1415 Terminating a coroutine cycle is more complex than a generator cycle, because it requires context switching to the program main's \emph{stack} to shutdown the program, whereas generators started by the program main run on its stack. 1420 Furthermore, each deallocated coroutine must execute all destructors for object sallocated in the coroutine type \emph{and} allocated on the coroutine's stack at the point of suspension, which can be arbitrarily deep.1416 Furthermore, each deallocated coroutine must execute all destructors for object allocated in the coroutine type \emph{and} allocated on the coroutine's stack at the point of suspension, which can be arbitrarily deep. 1421 1417 In the example, termination begins with the producer's loop stopping after N iterations and calling the consumer's @stop@ function, which sets the @done@ flag, resumes the consumer in function @payment@, terminating the call, and the consumer's loop in its coroutine main. 1422 1418 % (Not shown is having @prod@ raise a nonlocal @stop@ exception at @cons@ after it finishes generating values and suspend back to @cons@, which catches the @stop@ exception to terminate its loop.) … … 1442 1438 if @ping@ ends first, it resumes its starter the program main on return. 1443 1439 Regardless of the cycle complexity, the starter structure always leads back to the program main, but the path can be entered at an arbitrary point. 1444 Once back at the program main (creator), coroutines @ping@ and @pong@ are deallocated, runn ing any destructors for objects within the coroutine and possibly deallocating any coroutine stacks for non-terminated coroutines, where stack deallocation implies stack unwinding to find destructors for allocated objects on the stack.1445 Hence, the \CFA termination semantics for the generator and coroutine ensure correct deallocation sem antics, regardless of the coroutine's state (terminated or active), like any other aggregate object.1440 Once back at the program main (creator), coroutines @ping@ and @pong@ are deallocated, runnning any destructors for objects within the coroutine and possibly deallocating any coroutine stacks for non-terminated coroutines, where stack deallocation implies stack unwinding to find destructors for allocated objects on the stack. 1441 Hence, the \CFA termination semantics for the generator and coroutine ensure correct deallocation semnatics, regardless of the coroutine's state (terminated or active), like any other aggregate object. 1446 1442 1447 1443 … … 1449 1445 1450 1446 A significant implementation challenge for generators and coroutines (and threads in Section~\ref{s:threads}) is adding extra fields to the custom types and related functions, \eg inserting code after/before the coroutine constructor/destructor and @main@ to create/initialize/de-initialize/destroy any extra fields, \eg the coroutine stack. 1451 There are several solutions to th isproblem, which follow from the object-oriented flavour of adopting custom types.1447 There are several solutions to these problem, which follow from the object-oriented flavour of adopting custom types. 1452 1448 1453 1449 For object-oriented languages, inheritance is used to provide extra fields and code via explicit inheritance: … … 1484 1480 forall( `dtype` T | is_coroutine(T) ) void $suspend$( T & ), resume( T & ); 1485 1481 \end{cfa} 1486 Note, copying generators, coroutines, and threads is undefined because mul tiple objects cannot execute on a shared stack and stack copying does not work in unmanaged languages (no garbage collection), like C, because the stack may contain pointers to objects within it that require updating for the copy.1482 Note, copying generators, coroutines, and threads is undefined because muliple objects cannot execute on a shared stack and stack copying does not work in unmanaged languages (no garbage collection), like C, because the stack may contain pointers to objects within it that require updating for the copy. 1487 1483 The \CFA @dtype@ property provides no \emph{implicit} copying operations and the @is_coroutine@ trait provides no \emph{explicit} copying operations, so all coroutines must be passed by reference or pointer. 1488 1484 The function definitions ensure there is a statically typed @main@ function that is the starting point (first stack frame) of a coroutine, and a mechanism to read the coroutine descriptor from its handle. … … 1629 1625 MyThread * team = factory( 10 ); 1630 1626 // concurrency 1631 ` adelete( team );` $\C{// deallocate heap-based threads, implicit joins before destruction}\CRT$1627 `delete( team );` $\C{// deallocate heap-based threads, implicit joins before destruction}\CRT$ 1632 1628 } 1633 1629 \end{cfa} … … 1706 1702 Unrestricted nondeterminism is meaningless as there is no way to know when a result is completed and safe to access. 1707 1703 To produce meaningful execution requires clawing back some determinism using mutual exclusion and synchronization, where mutual exclusion provides access control for threads using shared data, and synchronization is a timing relationship among threads~\cite[\S~4]{Buhr05a}. 1708 The shared data protected by mutual ex clusion is called a \newterm{critical section}~\cite{Dijkstra65}, and the protection can be simple, only 1 thread, or complex, only N kinds of threads, \eg group~\cite{Joung00} or readers/writer~\cite{Courtois71} problems.1704 The shared data protected by mutual exlusion is called a \newterm{critical section}~\cite{Dijkstra65}, and the protection can be simple, only 1 thread, or complex, only N kinds of threads, \eg group~\cite{Joung00} or readers/writer~\cite{Courtois71} problems. 1709 1705 Without synchronization control in a critical section, an arriving thread can barge ahead of preexisting waiter threads resulting in short/long-term starvation, staleness and freshness problems, and incorrect transfer of data. 1710 1706 Preventing or detecting barging is a challenge with low-level locks, but made easier through higher-level constructs. … … 1830 1826 \end{cquote} 1831 1827 The @dtype@ property prevents \emph{implicit} copy operations and the @is_monitor@ trait provides no \emph{explicit} copy operations, so monitors must be passed by reference or pointer. 1832 Similarly, the function definitions ensure there is a mechanism to read the monitor descriptor from its handle, and a special destructor to prevent deallocation if a thread is using the shared data.1828 Similarly, the function definitions ensures there is a mechanism to read the monitor descriptor from its handle, and a special destructor to prevent deallocation if a thread is using the shared data. 1833 1829 The custom monitor type also inserts any locks needed to implement the mutual exclusion semantics. 1834 1830 \CFA relies heavily on traits as an abstraction mechanism, so the @mutex@ qualifier prevents coincidentally matching of a monitor trait with a type that is not a monitor, similar to coincidental inheritance where a shape and playing card can both be drawable. … … 2483 2479 2484 2480 One scheduling solution is for the signaller S to keep ownership of all locks until the last lock is ready to be transferred, because this semantics fits most closely to the behaviour of single-monitor scheduling. 2485 However, this solution is inefficient if W2 waited first and immediate passed @m2@ when released, while S retains @m1@ until completion of the outer mutex statement.2481 However, this solution is inefficient if W2 waited first and can be immediate passed @m2@ when released, while S retains @m1@ until completion of the outer mutex statement. 2486 2482 If W1 waited first, the signaller must retain @m1@ amd @m2@ until completion of the outer mutex statement and then pass both to W1. 2487 2483 % Furthermore, there is an execution sequence where the signaller always finds waiter W2, and hence, waiter W1 starves. 2488 To support th eseefficient semantics and prevent barging, the implementation maintains a list of monitors acquired for each blocked thread.2484 To support this efficient semantics and prevent barging, the implementation maintains a list of monitors acquired for each blocked thread. 2489 2485 When a signaller exits or waits in a mutex function or statement, the front waiter on urgent is unblocked if all its monitors are released. 2490 Implementing a fast subset check for the necessar ily released monitors is important and discussed in the following sections.2486 Implementing a fast subset check for the necessary released monitors is important and discussed in the following sections. 2491 2487 % The benefit is encapsulating complexity into only two actions: passing monitors to the next owner when they should be released and conditionally waking threads if all conditions are met. 2492 2488 … … 2547 2543 Hence, function pointers are used to identify the functions listed in the @waitfor@ statement, stored in a variable-sized array. 2548 2544 Then, the same implementation approach used for the urgent stack (see Section~\ref{s:Scheduling}) is used for the calling queue. 2549 Each caller has a list of monitors acquired, and the @waitfor@ statement performs a short linear search matching functions in the @waitfor@ list with called functions, and then verifying the associated mutex locks can be transfer red.2545 Each caller has a list of monitors acquired, and the @waitfor@ statement performs a short linear search matching functions in the @waitfor@ list with called functions, and then verifying the associated mutex locks can be transfers. 2550 2546 2551 2547 … … 2782 2778 The \CFA program @main@ uses the call/return paradigm to directly communicate with the @GoRtn main@, whereas Go switches to the unbuffered channel paradigm to indirectly communicate with the goroutine. 2783 2779 Communication by multiple threads is safe for the @gortn@ thread via mutex calls in \CFA or channel assignment in Go. 2784 The differen cebetween call and channel send occurs for buffered channels making the send asynchronous.2785 In \CFA, asynchronous call and multiple buffers areprovided using an administrator and worker threads~\cite{Gentleman81} and/or futures (not discussed).2780 The different between call and channel send occurs for buffered channels making the send asynchronous. 2781 In \CFA, asynchronous call and multiple buffers is provided using an administrator and worker threads~\cite{Gentleman81} and/or futures (not discussed). 2786 2782 2787 2783 Figure~\ref{f:DirectCommunicationDatingService} shows the dating-service problem in Figure~\ref{f:DatingServiceMonitor} extended from indirect monitor communication to direct thread communication. 2788 When converting a monitor to a thread (server), the coding pattern is to move as much code as possible from the accepted functions into the thread main so it does a smuch work as possible.2784 When converting a monitor to a thread (server), the coding pattern is to move as much code as possible from the accepted functions into the thread main so it does an much work as possible. 2789 2785 Notice, the dating server is postponing requests for an unspecified time while continuing to accept new requests. 2790 2786 For complex servers, \eg web-servers, there can be hundreds of lines of code in the thread main and safe interaction with clients can be complex. … … 2794 2790 2795 2791 For completeness and efficiency, \CFA provides a standard set of low-level locks: recursive mutex, condition, semaphore, barrier, \etc, and atomic instructions: @fetchAssign@, @fetchAdd@, @testSet@, @compareSet@, \etc. 2796 Some of these low-level mechanism sare used to build the \CFA runtime, but we always advocate using high-level mechanisms whenever possible.2792 Some of these low-level mechanism are used to build the \CFA runtime, but we always advocate using high-level mechanisms whenever possible. 2797 2793 2798 2794 … … 2984 2980 2985 2981 To test the performance of the \CFA runtime, a series of microbenchmarks are used to compare \CFA with pthreads, Java 11.0.6, Go 1.12.6, Rust 1.37.0, Python 3.7.6, Node.js 12.14.1, and \uC 7.0.0. 2986 For comparison, the package must be multi-processor (M:N), which excludes libdil and libmil~\cite{libdill} (M:1)), and use a shared-memory programming model, \eg not message passing.2982 For comparison, the package must be multi-processor (M:N), which excludes libdil and /libmil~\cite{libdill} (M:1)), and use a shared-memory programming model, \eg not message passing. 2987 2983 The benchmark computer is an AMD Opteron\texttrademark\ 6380 NUMA 64-core, 8 socket, 2.5 GHz processor, running Ubuntu 16.04.6 LTS, and pthreads/\CFA/\uC are compiled with gcc 9.2.1. 2988 2984 … … 3053 3049 Figure~\ref{f:schedint} shows the code for \CFA, with results in Table~\ref{t:schedint}. 3054 3050 Note, the incremental cost of bulk acquire for \CFA, which is largely a fixed cost for small numbers of mutex objects. 3055 Java scheduling is significantly greater because the benchmark explicitly creates multiple thread sin order to prevent the JIT from making the program sequential, \ie removing all locking.3051 Java scheduling is significantly greater because the benchmark explicitly creates multiple thread in order to prevent the JIT from making the program sequential, \ie removing all locking. 3056 3052 3057 3053 \begin{multicols}{2} … … 3312 3308 This type of concurrency can be achieved both at the language level and at the library level. 3313 3309 The canonical example of implicit concurrency is concurrent nested @for@ loops, which are amenable to divide and conquer algorithms~\cite{uC++book}. 3314 The \CFA language features should make it possible to develop a reasonable number of implicit concurrency mechanism sto solve basic HPC data-concurrency problems.3310 The \CFA language features should make it possible to develop a reasonable number of implicit concurrency mechanism to solve basic HPC data-concurrency problems. 3315 3311 However, implicit concurrency is a restrictive solution with significant limitations, so it can never replace explicit concurrent programming. 3316 3312 -
doc/papers/concurrency/figures/RunTimeStructure.fig
rb8e3941 rfb19194 8 8 -2 9 9 1200 2 10 6 3 255 2475 3555 262511 1 3 0 1 0 0 0 0 0 0.000 1 0.0000 3 330 2550 30 30 3330 2550 3360 258012 1 3 0 1 0 0 0 0 0 0.000 1 0.0000 3435 2550 30 30 3435 2550 3465 258010 6 3855 2775 4155 2925 11 1 3 0 1 0 0 0 0 0 0.000 1 0.0000 3930 2850 30 30 3930 2850 3960 2880 12 1 3 0 1 0 0 0 0 0 0.000 1 0.0000 4035 2850 30 30 4035 2850 4065 2880 13 13 -6 14 6 4 155 3225 4455 337515 1 3 0 1 0 0 0 0 0 0.000 1 0.0000 4 230 3300 30 30 4230 3300 4260 333016 1 3 0 1 0 0 0 0 0 0.000 1 0.0000 4 335 3300 30 30 4335 3300 4365 333014 6 4755 3525 5055 3675 15 1 3 0 1 0 0 0 0 0 0.000 1 0.0000 4830 3600 30 30 4830 3600 4860 3630 16 1 3 0 1 0 0 0 0 0 0.000 1 0.0000 4935 3600 30 30 4935 3600 4965 3630 17 17 -6 18 6 4 050 2475 4350 262519 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 4 125 2550 15 15 4125 2550 4140 256520 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 4 200 2550 15 15 4200 2550 4215 256521 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 4 275 2550 15 15 4275 2550 4290 256518 6 4650 2775 4950 2925 19 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 4725 2850 15 15 4725 2850 4740 2865 20 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 4800 2850 15 15 4800 2850 4815 2865 21 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 4875 2850 15 15 4875 2850 4890 2865 22 22 -6 23 6 2625 2100 2925 225024 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 2700 2175 15 15 2700 2175 2715 219025 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 2775 2175 15 15 2775 2175 2790 219026 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 2850 2175 15 15 2850 2175 2865 219023 6 3225 2400 3525 2550 24 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 3300 2475 15 15 3300 2475 3315 2490 25 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 3375 2475 15 15 3375 2475 3390 2490 26 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 3450 2475 15 15 3450 2475 3465 2490 27 27 -6 28 6 4875 3150 5025 345029 1 3 0 1 -1 -1 0 0 20 0.000 1 4.7120 4950 3225 15 15 4950 3225 4935 324030 1 3 0 1 -1 -1 0 0 20 0.000 1 4.7120 4950 3300 15 15 4950 3300 4935 331531 1 3 0 1 -1 -1 0 0 20 0.000 1 4.7120 4950 3375 15 15 4950 3375 4935 339028 6 5475 3450 5625 3750 29 1 3 0 1 -1 -1 0 0 20 0.000 1 4.7120 5550 3525 15 15 5550 3525 5535 3540 30 1 3 0 1 -1 -1 0 0 20 0.000 1 4.7120 5550 3600 15 15 5550 3600 5535 3615 31 1 3 0 1 -1 -1 0 0 20 0.000 1 4.7120 5550 3675 15 15 5550 3675 5535 3690 32 32 -6 33 6 3675 3225 3975 337534 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 3750 3300 15 15 3750 3300 3765 331535 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 3825 3300 15 15 3825 3300 3840 331536 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 3900 3300 15 15 3900 3300 3915 331533 6 4275 3525 4575 3675 34 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 4350 3600 15 15 4350 3600 4365 3615 35 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 4425 3600 15 15 4425 3600 4440 3615 36 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 4500 3600 15 15 4500 3600 4515 3615 37 37 -6 38 6 2625 3825 4050 412539 6 3750 3900 4050 405040 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 3825 3975 15 15 3825 3975 3840 399041 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 3900 3975 15 15 3900 3975 3915 399042 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 3975 3975 15 15 3975 3975 3990 399038 6 3225 4125 4650 4425 39 6 4350 4200 4650 4350 40 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 4425 4275 15 15 4425 4275 4440 4290 41 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 4500 4275 15 15 4500 4275 4515 4290 42 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 4575 4275 15 15 4575 4275 4590 4290 43 43 -6 44 1 1 0 1 -1 -1 0 0 -1 0.000 1 0.0000 2850 3975 225 150 2850 3975 3075 412545 1 1 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3450 3975 225 150 3450 3975 3675 412544 1 1 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3450 4275 225 150 3450 4275 3675 4425 45 1 1 0 1 -1 -1 0 0 -1 0.000 1 0.0000 4050 4275 225 150 4050 4275 4275 4425 46 46 -6 47 6 6 075 3825 6900 412548 6 6600 3900 6900 405049 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 6675 3975 15 15 6675 3975 6690 399050 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 6750 3975 15 15 6750 3975 6765 399051 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 6825 3975 15 15 6825 3975 6840 399047 6 6675 4125 7500 4425 48 6 7200 4200 7500 4350 49 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 7275 4275 15 15 7275 4275 7290 4290 50 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 7350 4275 15 15 7350 4275 7365 4290 51 1 3 0 1 -1 -1 0 0 20 0.000 1 0.0000 7425 4275 15 15 7425 4275 7440 4290 52 52 -6 53 1 1 0 1 -1 -1 0 0 -1 0.000 1 0.0000 6 300 3975 225 150 6300 3975 6525 412553 1 1 0 1 -1 -1 0 0 -1 0.000 1 0.0000 6900 4275 225 150 6900 4275 7125 4425 54 54 -6 55 6 6 075 3225 7425 367555 6 6675 3525 8025 3975 56 56 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 57 57 1 1 1.00 45.00 90.00 58 6 075 3450 6375 345058 6675 3750 6975 3750 59 59 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 60 60 1 1 1.00 45.00 90.00 61 6525 3450 6750 345061 7125 3750 7350 3750 62 62 2 2 0 1 -1 -1 0 0 -1 0.000 0 0 0 0 0 5 63 7 200 3675 7200 3225 6750 3225 6750 3675 7200 367563 7800 3975 7800 3525 7350 3525 7350 3975 7800 3975 64 64 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 65 65 1 1 1.00 45.00 90.00 66 7 200 3450 7425 345066 7800 3750 8025 3750 67 67 -6 68 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 4950 2325 150 150 4950 2325 5100 232569 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 4950 2925 150 150 4950 2925 5100 292570 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 4950 3675 150 150 4950 3675 5100 367571 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 2925 2550 150 150 2925 2550 3075 255072 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3600 2175 150 150 3600 2175 3750 217573 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3825 2550 150 150 3825 2550 3975 255074 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 4 050 2175 150 150 4050 2175 4200 217575 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3 375 3300 150 150 3375 3300 3525 330076 1 3 0 1 0 0 0 0 0 0.000 1 0.0000 2925 3300 30 30 2925 3300 2955 333077 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3 150 2175 150 150 3150 2175 3300 232578 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 4 275 3300 150 150 4275 3300 4425 345079 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3 375 2550 150 150 3375 2550 3525 255080 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 6600 2475 150 150 6600 2475 6750 247581 1 3 0 1 0 0 0 0 0 0.000 1 0.0000 1650 4530 30 30 1650 4530 1680 456082 1 3 0 1 0 0 0 0 0 0.000 1 0.0000 6600 2475 30 30 6600 2475 6630 250583 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 2925 3300 150 150 2925 3300 3075 330084 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3 275 4500 100 100 3275 4500 3375 450085 1 1 0 1 -1 -1 0 0 -1 0.000 1 0.0000 4 050 4500 150 75 4050 4500 4200 457568 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 5550 2625 150 150 5550 2625 5700 2625 69 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 5550 3225 150 150 5550 3225 5700 3225 70 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 5550 3975 150 150 5550 3975 5700 3975 71 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3525 2850 150 150 3525 2850 3675 2850 72 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 4200 2475 150 150 4200 2475 4350 2475 73 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 4425 2850 150 150 4425 2850 4575 2850 74 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 4650 2475 150 150 4650 2475 4800 2475 75 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3975 3600 150 150 3975 3600 4125 3600 76 1 3 0 1 0 0 0 0 0 0.000 1 0.0000 3525 3600 30 30 3525 3600 3555 3630 77 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3750 2475 150 150 3750 2475 3900 2625 78 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 4875 3600 150 150 4875 3600 5025 3750 79 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3975 2850 150 150 3975 2850 4125 2850 80 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 7200 2775 150 150 7200 2775 7350 2775 81 1 3 0 1 0 0 0 0 0 0.000 1 0.0000 2250 4830 30 30 2250 4830 2280 4860 82 1 3 0 1 0 0 0 0 0 0.000 1 0.0000 7200 2775 30 30 7200 2775 7230 2805 83 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3525 3600 150 150 3525 3600 3675 3600 84 1 3 0 1 -1 -1 0 0 -1 0.000 1 0.0000 3875 4800 100 100 3875 4800 3975 4800 85 1 1 0 1 -1 -1 0 0 -1 0.000 1 0.0000 4650 4800 150 75 4650 4800 4800 4875 86 86 2 2 0 1 -1 -1 0 0 -1 0.000 0 0 0 0 0 5 87 1800 3900 1800 3450 1350 3450 1350 3900 1800 390087 2400 4200 2400 3750 1950 3750 1950 4200 2400 4200 88 88 2 2 1 1 -1 -1 0 0 -1 4.000 0 0 0 0 0 5 89 5700 4200 5700 1500 2400 1500 2400 4200 5700 420089 6300 4500 6300 1800 3000 1800 3000 4500 6300 4500 90 90 2 2 0 1 -1 -1 0 0 -1 0.000 0 0 0 0 0 5 91 5 175 2550 5175 2100 4725 2100 4725 2550 5175 255091 5775 2850 5775 2400 5325 2400 5325 2850 5775 2850 92 92 2 2 0 1 -1 -1 0 0 -1 0.000 0 0 0 0 0 5 93 5 175 3900 5175 3450 4725 3450 4725 3900 5175 390093 5775 4200 5775 3750 5325 3750 5325 4200 5775 4200 94 94 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 95 95 1 1 1.00 45.00 90.00 96 4575 3675 4725 367596 5175 3975 5325 3975 97 97 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 98 98 1 1 1.00 45.00 90.00 99 4575 2925 4725 292599 5175 3225 5325 3225 100 100 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 101 101 1 1 1.00 45.00 90.00 102 4575 2325 4725 2325102 5175 2625 5325 2625 103 103 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 104 104 1 1 1.00 45.00 90.00 105 5 175 3675 5325 3675105 5775 3975 5925 3975 106 106 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 107 107 1 1 1.00 45.00 90.00 108 5 175 2925 5325 2925108 5775 3225 5925 3225 109 109 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 110 110 1 1 1.00 45.00 90.00 111 5 175 2325 5325 2325111 5775 2625 5925 2625 112 112 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 113 4575 3675 4575 2325113 5175 3975 5175 2625 114 114 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 115 115 1 1 1.00 45.00 90.00 116 5 325 3675 5325 1725116 5925 3975 5925 2025 117 117 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 118 118 1 1 1.00 45.00 90.00 119 5 325 3450 5625 3450119 5925 3750 6225 3750 120 120 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 121 121 1 1 1.00 45.00 90.00 122 2850 2325 2625 2325122 3450 2625 3225 2625 123 123 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 3 124 124 1 1 1.00 45.00 90.00 125 5 325 1725 3600 1725 3600 1950125 5925 2025 4200 2025 4200 2250 126 126 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 127 2625 2325 2625 3300127 3225 2625 3225 3600 128 128 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 129 129 1 1 1.00 45.00 90.00 130 2475 3300 2775 3300130 3075 3600 3375 3600 131 131 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 132 132 1 1 1.00 45.00 90.00 133 3 075 3300 3225 3300133 3675 3600 3825 3600 134 134 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 135 135 1 1 1.00 45.00 90.00 136 3525 3300 3675 3300136 4125 3600 4275 3600 137 137 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 138 138 1 1 1.00 45.00 90.00 139 3975 3300 4125 3300139 4575 3600 4725 3600 140 140 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 141 141 1 1 1.00 45.00 90.00 142 4425 3300 4575 3300142 5025 3600 5175 3600 143 143 2 2 0 1 -1 -1 0 0 -1 0.000 0 0 0 0 0 5 144 5 175 3150 5175 2700 4725 2700 4725 3150 5175 3150144 5775 3450 5775 3000 5325 3000 5325 3450 5775 3450 145 145 2 2 1 1 -1 -1 0 0 -1 4.000 0 0 0 0 0 5 146 7500 4200 7500 1500 6000 1500 6000 4200 7500 4200146 8100 4500 8100 1800 6600 1800 6600 4500 8100 4500 147 147 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 2 148 148 1 1 1.00 45.00 90.00 149 6450 2475 6225 2475149 7050 2775 6825 2775 150 150 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 0 0 2 151 6 225 2475 6225 3450151 6825 2775 6825 3750 152 152 2 1 0 1 -1 -1 0 0 -1 0.000 0 0 -1 1 0 4 153 153 1 1 1.00 45.00 90.00 154 7 275 3450 7275 2025 6600 2025 6600 2250154 7875 3750 7875 2325 7200 2325 7200 2550 155 155 2 2 0 1 -1 -1 0 0 -1 0.000 0 0 0 0 0 5 156 5 250 4650 5250 4425 5025 4425 5025 4650 5250 4650156 5850 4950 5850 4725 5625 4725 5625 4950 5850 4950 157 157 2 2 1 1 -1 -1 0 0 -1 3.000 0 0 0 0 0 5 158 6 375 4650 6150 4650 6150 4425 6375 4425 6375 4650159 4 1 -1 0 0 0 10 0.0000 2 105 720 4950 4125 Processors\001160 4 1 -1 0 0 0 10 0.0000 2 120 1005 3600 2925 Blocked Tasks\001161 4 1 -1 0 0 0 10 0.0000 2 150 870 3600 3675 Ready Tasks\001162 4 1 -1 0 0 0 10 0.0000 2 135 1095 6750 1425 Other Cluster(s)\001163 4 1 -1 0 0 0 10 0.0000 2 105 840 4 050 1425 User Cluster\001164 4 1 -1 0 0 0 10 0.0000 2 150 615 1575 3375 Manager\001165 4 1 -1 0 0 0 10 0.0000 2 105 990 1575 3225 Discrete-event\001166 4 1 -1 0 0 0 10 0.0000 2 135 795 1575 4050 preemption\001167 4 0 -1 0 0 0 10 0.0000 2 150 1 365 1725 4575 generator/coroutine\001168 4 0 -1 0 0 0 10 0.0000 2 120 270 3450 4575 task\001169 4 0 -1 0 0 0 10 0.0000 2 105 450 6450 4575 cluster\001170 4 0 -1 0 0 0 10 0.0000 2 105 660 5 325 4575 processor\001171 4 0 -1 0 0 0 10 0.0000 2 105 555 4 275 4575 monitor\001158 6975 4950 6750 4950 6750 4725 6975 4725 6975 4950 159 4 1 -1 0 0 0 10 0.0000 2 105 720 5550 4425 Processors\001 160 4 1 -1 0 0 0 10 0.0000 2 120 1005 4200 3225 Blocked Tasks\001 161 4 1 -1 0 0 0 10 0.0000 2 150 870 4200 3975 Ready Tasks\001 162 4 1 -1 0 0 0 10 0.0000 2 135 1095 7350 1725 Other Cluster(s)\001 163 4 1 -1 0 0 0 10 0.0000 2 105 840 4650 1725 User Cluster\001 164 4 1 -1 0 0 0 10 0.0000 2 150 615 2175 3675 Manager\001 165 4 1 -1 0 0 0 10 0.0000 2 105 990 2175 3525 Discrete-event\001 166 4 1 -1 0 0 0 10 0.0000 2 135 795 2175 4350 preemption\001 167 4 0 -1 0 0 0 10 0.0000 2 150 1290 2325 4875 genrator/coroutine\001 168 4 0 -1 0 0 0 10 0.0000 2 120 270 4050 4875 task\001 169 4 0 -1 0 0 0 10 0.0000 2 105 450 7050 4875 cluster\001 170 4 0 -1 0 0 0 10 0.0000 2 105 660 5925 4875 processor\001 171 4 0 -1 0 0 0 10 0.0000 2 105 555 4875 4875 monitor\001 -
doc/papers/concurrency/mail2
rb8e3941 rfb19194 934 934 Page 18, line 17: is using 935 935 936 937 938 Date: Tue, 16 Jun 2020 13:45:03 +0000939 From: Aaron Thomas <onbehalfof@manuscriptcentral.com>940 Reply-To: speoffice@wiley.com941 To: tdelisle@uwaterloo.ca, pabuhr@uwaterloo.ca942 Subject: SPE-19-0219.R2 successfully submitted943 944 16-Jun-2020945 946 Dear Dr Buhr,947 948 Your manuscript entitled "Advanced Control-flow and Concurrency in Cforall" has been successfully submitted online and is presently being given full consideration for publication in Software: Practice and Experience.949 950 Your manuscript number is SPE-19-0219.R2. Please mention this number in all future correspondence regarding this submission.951 952 You can view the status of your manuscript at any time by checking your Author Center after logging into https://mc.manuscriptcentral.com/spe. If you have difficulty using this site, please click the 'Get Help Now' link at the top right corner of the site.953 954 955 Thank you for submitting your manuscript to Software: Practice and Experience.956 957 Sincerely,958 959 Software: Practice and Experience Editorial Office960 -
doc/papers/concurrency/response2
rb8e3941 rfb19194 27 27 thread creation and destruction? 28 28 29 Fixed, changed sentence to: 30 31 A programmer needs mechanisms to create, block and unblock, and join with a 32 thread, even if these basic mechanisms are supplied indirectly through 33 high-level features. 29 The best description of Smalltalk concurrency I can find is in J. Hunt, 30 Smalltalk and Object Orientation, Springer-Verlag London Limited, 1997, Chapter 31 31 Concurrency in Smalltalk. It states on page 332: 32 33 For a process to be spawned from the current process there must be some way 34 of creating a new process. This is done using one of four messages to a 35 block. These messages are: 36 37 aBlock fork: This creates and schedules a process which will execute the 38 block. The priority of this process is inherited from the parent process. 39 ... 40 41 The Semaphore class provides facilities for achieving simple synchronization, 42 it is simple because it only allows for two forms of communication signal and 43 wait. 44 45 Hence, "aBlock fork" creates, "Semaphore" blocks/unblocks (as does message send 46 to an aBlock object), and garbage collection of an aBlock joins with its 47 thread. The fact that a programmer *implicitly* does "fork", "block"/"unblock", 48 and "join", does not change their fundamental requirement. 34 49 35 50 … … 88 103 storage, too, which is a single instance across all generator instances of that 89 104 type, as for static storage in an object type. All the kinds of storage are 90 at play with semantics that is the same as in other languages.105 at play with semantics that is virtually the same as in other languages. 91 106 92 107 … … 103 118 Just-in-Time Compiler. We modified our test programs based on his advise, and 104 119 he validated our programs as correctly measuring the specified language 105 feature. Dave's help is recognized in the Acknowledgment section. Similarly, 106 we verified our Node.js programs with Gregor Richards, an expert in 107 just-in-time compilation for dynamic typing. Hence, we have taken into account 108 all issues related to performing benchmarks in JITTED languages. Also, all the 109 benchmark programs are publicly available for independent verification. 120 feature. Hence, we have taken into account all issues related to performing 121 benchmarks in JITTED languages. Dave's help is recognized in the 122 Acknowledgment section. Also, all the benchmark programs are publicly available 123 for independent verification. 124 125 Similarly, we verified our Node.js programs with Gregor Richards, an expert in 126 just-in-time compilation for dynamic typing. 110 127 111 128 … … 138 155 Since many aspects of Cforall are not OO, the rest of the paper *does* depend 139 156 on Cforall being identified as non-OO, otherwise readers would have 140 significantly different expectations for the design. We did not mean to suggest 141 that languages that support function pointers with structures support an OO 142 style. We revised the footnote to avoid this interpretation. Finally, Golang 143 does not identify itself as an OO language. 144 https://golang.org/doc/faq#Is_Go_an_object-oriented_language 157 significantly different expectations for the design. We believe your definition 158 of OO is too broad, such as including C. Just because a programming language 159 can support aspects of the OO programming style, does not make it OO. (Just 160 because a duck can swim does not make it a fish.) 161 162 Our definition of non-OO follows directly from the Wikipedia entry: 163 164 Object-oriented programming (OOP) is a programming paradigm based on the 165 concept of "objects", which can contain data, in the form of fields (often 166 known as attributes or properties), and code, in the form of procedures 167 (often known as methods). A feature of objects is an object's procedures that 168 can access and often modify the data fields of the object with which they are 169 associated (objects have a notion of "this" or "self"). 170 https://en.wikipedia.org/wiki/Object-oriented_programming 171 172 Cforall fails this definition as code cannot appear in an "object" and there is 173 no implicit receiver. As well, Cforall, Go, and Rust do not have nominal 174 inheritance and they not considered OO languages, e.g.: 175 176 "**Is Go an object-oriented language?** Yes and no. Although Go has types and 177 methods and allows an object-oriented style of programming, there is no type 178 hierarchy. The concept of "interface" in Go provides a different approach 179 that we believe is easy to use and in some ways more general. There are also 180 ways to embed types in other types to provide something analogous-but not 181 identical-to subclassing. Moreover, methods in Go are more general than in 182 C++ or Java: they can be defined for any sort of data, even built-in types 183 such as plain, "unboxed" integers. They are not restricted to structs (classes). 184 https://golang.org/doc/faq#Is_Go_an_object-oriented_language 145 185 146 186 … … 179 219 Whereas, the coroutine only needs the array allocated when needed. Now a 180 220 coroutine has a stack which occupies storage, but the maximum stack size only 181 needs to be the call chain allocating the most storage, where as the generator221 needs to be the call chain allocating the most storage, where as the generator 182 222 has a maximum size of all variable that could be created. 183 223 … … 274 314 275 315 \item[\newterm{execution state}:] is the state information needed by a 276 control-flow feature to initialize and manage bothcompute data and execution277 location(s), and de-initialize . For example, calling a function initializes a278 stack frame including contained objects with constructors, manages local data279 inblocks and return locations during calls, and de-initializes the frame by316 control-flow feature to initialize, manage compute data and execution 317 location(s), and de-initialize, \eg calling a function initializes a stack 318 frame including contained objects with constructors, manages local data in 319 blocks and return locations during calls, and de-initializes the frame by 280 320 running any object destructors and management operations. 281 321 … … 290 330 appropriate word? 291 331 292 293 332 "computation only" as opposed to what? 294 333 … … 296 335 i.e., the operation starts with everything it needs to compute its result and 297 336 runs to completion, blocking only when it is done and returns its result. 298 Computation only occurs in "embarrassingly parallel" problems.299 337 300 338 … … 558 596 * coroutines/generators/threads: here there is some discussion, but it can 559 597 be improved. 560 * inter nal/external scheduling: I didn't find any direct comparison between598 * interal/external scheduling: I didn't find any direct comparison between 561 599 these features, except by way of example. 562 600 … … 634 672 } 635 673 636 Additional text has been added to the start of Section 3.2 addressing this 637 comment. 674 Additonal text has been added to the start of Section 3.2 address this comment. 638 675 639 676 … … 750 787 and its shorthand form (not shown in the paper) 751 788 752 waitfor( remove, remove2 : buffer);753 754 A call to either of these remove functions satisfies the waitfor (exact755 selectiondetails are discussed in Section 6.4).789 waitfor( remove, remove2 : t ); 790 791 A call to one these remove functions satisfies the waitfor (exact selection 792 details are discussed in Section 6.4). 756 793 757 794 … … 798 835 signal or signal_block. 799 836 800 801 837 I believe that one difference between the Go program and the Cforall 802 838 equivalent is that the Goroutine has an associated queue, so that … … 806 842 Actually, the buffer length is 0 for the Cforall call and the Go unbuffered 807 843 send so both are synchronous communication. 808 809 844 810 845 I think this should be stated explicitly. (Presumably, one could modify the … … 950 985 sout | "join"; 951 986 } 952 953 987 int main() { 954 988 T t[3]; // threads start and delay -
libcfa/src/bits/debug.cfa
rb8e3941 rfb19194 10 10 // Created On : Thu Mar 30 12:30:01 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 17 11:07:13202013 // Update Count : 1 212 // Last Modified On : Tue Feb 4 13:03:16 2020 13 // Update Count : 11 14 14 // 15 15 16 extern "C" { 16 17 #include <stdio.h> 17 18 #include <stdlib.h> … … 20 21 #include <stdarg.h> 21 22 #include <unistd.h> 23 } 22 24 23 25 enum { buffer_size = 4096 }; -
libcfa/src/bits/signal.hfa
rb8e3941 rfb19194 19 19 #include "bits/defs.hfa" 20 20 21 extern "C" { 21 22 #include <errno.h> 22 23 #define __USE_GNU … … 25 26 #include <stdlib.h> 26 27 #include <string.h> 28 } 27 29 28 30 // Short hands for signal context information -
libcfa/src/concurrency/alarm.cfa
rb8e3941 rfb19194 10 10 // Created On : Fri Jun 2 11:31:25 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 17 16:11:35202013 // Update Count : 7512 // Last Modified On : Sun Jan 5 08:41:36 2020 13 // Update Count : 69 14 14 // 15 15 16 16 #define __cforall_thread__ 17 17 18 extern "C" { 18 19 #include <errno.h> 19 20 #include <stdio.h> 21 #include <string.h> 20 22 #include <unistd.h> 21 #include <string.h>22 23 #include <sys/time.h> 24 } 23 25 24 26 #include "alarm.hfa" … … 53 55 } 54 56 55 void ?{}( alarm_node_t & this, processor * proc, Time alarm, Duration period ) with( this ) {57 void ?{}( alarm_node_t & this, processor * proc, Time alarm, Duration period ) with( this ) { 56 58 this.proc = proc; 57 59 this.alarm = alarm; -
libcfa/src/concurrency/preemption.cfa
rb8e3941 rfb19194 10 10 // Created On : Mon Jun 5 14:20:42 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 17 11:36:25 202013 // Update Count : 4 612 // Last Modified On : Thu Dec 5 16:34:05 2019 13 // Update Count : 43 14 14 // 15 15 … … 19 19 #include <assert.h> 20 20 21 extern "C" { 21 22 #include <errno.h> 22 23 #include <stdio.h> … … 24 25 #include <unistd.h> 25 26 #include <limits.h> // PTHREAD_STACK_MIN 27 } 26 28 27 29 #include "bits/signal.hfa" -
libcfa/src/containers/vector.hfa
rb8e3941 rfb19194 10 10 // Created On : Tue Jul 5 18:00:07 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 17 11:02:46 202013 // Update Count : 412 // Last Modified On : Sat Jul 22 10:01:18 2017 13 // Update Count : 3 14 14 // 15 15 16 16 #pragma once 17 17 18 extern "C" { 18 19 #include <stdbool.h> 20 } 19 21 20 22 //------------------------------------------------------------------------------ -
libcfa/src/fstream.cfa
rb8e3941 rfb19194 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 18 15:37:21 202013 // Update Count : 3 8012 // Last Modified On : Fri Feb 7 19:01:01 2020 13 // Update Count : 363 14 14 // 15 15 … … 123 123 #ifdef __CFA_DEBUG__ 124 124 if ( file == 0p ) { 125 throw (IO_OPEN_FAILURE){ os };126 125 abort | IO_MSG "open output file \"" | name | "\"" | nl | strerror( errno ); 127 126 } // if … … 135 134 136 135 void close( ofstream & os ) { 137 if ( (FILE *)(os.$file) == 0p ) return; 138 if ( (FILE *)(os.$file) == (FILE *)stdout || (FILE *)(os.$file) == (FILE *)stderr ) return; 136 if ( (FILE *)(os.$file) == stdout || (FILE *)(os.$file) == stderr ) return; 139 137 140 138 if ( fclose( (FILE *)(os.$file) ) == EOF ) { 141 139 abort | IO_MSG "close output" | nl | strerror( errno ); 142 140 } // if 143 os.$file = 0p;144 141 } // close 145 142 … … 222 219 #ifdef __CFA_DEBUG__ 223 220 if ( file == 0p ) { 224 throw (IO_OPEN_FAILURE){ is };225 221 abort | IO_MSG "open input file \"" | name | "\"" | nl | strerror( errno ); 226 222 } // if … … 234 230 235 231 void close( ifstream & is ) { 236 if ( (FILE *)(is.$file) == 0p ) return; 237 if ( (FILE *)(is.$file) == (FILE *)stdin ) return; 232 if ( (FILE *)(is.$file) == stdin ) return; 238 233 239 234 if ( fclose( (FILE *)(is.$file) ) == EOF ) { 240 235 abort | IO_MSG "close input" | nl | strerror( errno ); 241 236 } // if 242 is.$file = 0p;243 237 } // close 244 238 … … 282 276 ifstream & sin = sinFile, & stdin = sinFile; 283 277 284 285 //*********************************** exceptions ***********************************286 287 288 void ?{}( IO_OPEN_FAILURE & this, ofstream & ostream ) {289 VTABLE_INIT(this, IO_OPEN_FAILURE);290 this.ostream = &ostream;291 }292 void ?{}( IO_OPEN_FAILURE & this, ifstream & istream ) {293 VTABLE_INIT(this, IO_OPEN_FAILURE);294 this.istream = &istream;295 }296 const char * IO_OPEN_FAILURE_msg(IO_OPEN_FAILURE * this) {297 return "IO_OPEN_FAILURE";298 }299 VTABLE_INSTANCE(IO_OPEN_FAILURE)(IO_OPEN_FAILURE_msg);300 void throwIO_OPEN_FAILURE( ofstream & ostream ) {301 IO_OPEN_FAILURE exc = { ostream };302 }303 void throwIO_OPEN_FAILURE( ifstream & istream ) {304 IO_OPEN_FAILURE exc = { istream };305 }306 307 278 // Local Variables: // 308 279 // tab-width: 4 // -
libcfa/src/fstream.hfa
rb8e3941 rfb19194 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jun 16 20:41:21202013 // Update Count : 1 8412 // Last Modified On : Mon Feb 17 08:29:23 2020 13 // Update Count : 175 14 14 // 15 15 … … 17 17 18 18 #include "iostream.hfa" 19 #include <exception.hfa>20 19 21 20 … … 107 106 extern ifstream & sin, & stdin; // aliases 108 107 109 110 //*********************************** exceptions ***********************************111 112 113 DATA_EXCEPTION(IO_OPEN_FAILURE)(114 union {115 ofstream * ostream;116 ifstream * istream;117 };118 );119 120 void ?{}( IO_OPEN_FAILURE & this, ofstream & ostream );121 void ?{}( IO_OPEN_FAILURE & this, ifstream & istream );122 123 108 // Local Variables: // 124 109 // mode: c // -
libcfa/src/iostream.cfa
rb8e3941 rfb19194 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 17 08:48:53202013 // Update Count : 101 812 // Last Modified On : Sat May 2 18:30:25 2020 13 // Update Count : 1017 14 14 // 15 15 16 16 #include "iostream.hfa" 17 17 18 extern "C" { 18 19 #include <stdio.h> 19 20 #include <stdbool.h> // true/false 20 21 #include <stdint.h> // UINT64_MAX 21 #include <float.h> // DBL_DIG, LDBL_DIG22 #include <math.h> // isfinite23 #include <complex.h> // creal, cimag24 22 //#include <string.h> // strlen, strcmp 25 extern "C" {26 23 extern size_t strlen (const char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); 27 24 extern int strcmp (const char *__s1, const char *__s2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); 28 25 extern char *strcpy (char *__restrict __dest, const char *__restrict __src) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); 29 26 extern void *memcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); 27 #include <float.h> // DBL_DIG, LDBL_DIG 28 #include <math.h> // isfinite 29 #include <complex.h> // creal, cimag 30 30 } // extern "C" 31 31 -
libcfa/src/time.hfa
rb8e3941 rfb19194 10 10 // Created On : Wed Mar 14 23:18:57 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 17 16:13:00202013 // Update Count : 6 6312 // Last Modified On : Tue Feb 4 08:24:32 2020 13 // Update Count : 654 14 14 // 15 15 … … 20 20 21 21 #include <time.h> // timespec 22 extern "C" { 22 23 #include <sys/time.h> // timeval 24 } 23 25 #include <time_t.hfa> // Duration/Time types 24 26 … … 89 91 int64_t ?`w( Duration dur ) { return dur.tn / (7LL * 24LL * 60LL * 60LL * TIMEGRAN); } 90 92 91 double ?`dns( Duration dur ) { return dur.tn; }92 double ?`dus( Duration dur ) { return dur.tn / ((double)TIMEGRAN / 1_000_000.); }93 double ?`dms( Duration dur ) { return dur.tn / ((double)TIMEGRAN / 1_000.); }94 double ?`ds( Duration dur ) { return dur.tn / (double)TIMEGRAN; }95 double ?`dm( Duration dur ) { return dur.tn / (60. * TIMEGRAN); }96 double ?`dh( Duration dur ) { return dur.tn / (60. * 60. * (double)TIMEGRAN); }97 double ?`dd( Duration dur ) { return dur.tn / (24. * 60. * 60. * (double)TIMEGRAN); }98 double ?`dw( Duration dur ) { return dur.tn / (7. * 24. * 60. * 60. * (double)TIMEGRAN); }99 100 93 Duration max( Duration lhs, Duration rhs ) { return (lhs.tn < rhs.tn) ? rhs : lhs;} 101 94 Duration min( Duration lhs, Duration rhs ) { return !(rhs.tn < lhs.tn) ? lhs : rhs;} -
tests/.expect/time.txt
rb8e3941 rfb19194 1 1 10800 2 3.375 12 1.00001 2 0.125 0.0333333333333333 3.375 12000. 1000010.3 2 0 2 3.375 4 3 7 7 7 -
tests/time.cfa
rb8e3941 rfb19194 10 10 // Created On : Tue Mar 27 17:24:56 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 18 18:14:49202013 // Update Count : 3 712 // Last Modified On : Sun Jan 5 18:27:37 2020 13 // Update Count : 34 14 14 // 15 15 … … 20 20 Duration d1 = 3`h, d2 = 2`s, d3 = 3.375`s, d4 = 12`s, d5 = 1`s + 10_000`ns; 21 21 sout | d1 | d2 | d3 | d4 | d5; 22 sout | d1`dd | d2`dm | d3`ds | d4`dms | d5`dus;23 22 d1 = 0; 24 23 sout | d1 | d2 | d3;
Note: See TracChangeset
for help on using the changeset viewer.