Changes in / [b0ab7853:256728f]


Ignore:
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/concurrency/Paper.tex

    rb0ab7853 r256728f  
    22
    33\articletype{RESEARCH ARTICLE}%
     4
     5% Referees
     6% Doug Lea, dl@cs.oswego.edu, SUNY Oswego
     7% Herb Sutter, hsutter@microsoft.com, Microsoft Corp
     8% Gor Nishanov, gorn@microsoft.com, Microsoft Corp
     9% James Noble, kjx@ecs.vuw.ac.nz, Victoria University of Wellington, School of Engineering and Computer Science
    410
    511\received{XXXXX}
     
    312318As a result, languages like Java, Scala, Objective-C~\cite{obj-c-book}, \CCeleven~\cite{C11}, and C\#~\cite{Csharp} adopt the 1:1 kernel-threading model, with a variety of presentation mechanisms.
    313319From 2000 onwards, languages like Go~\cite{Go}, Erlang~\cite{Erlang}, Haskell~\cite{Haskell}, D~\cite{D}, and \uC~\cite{uC++,uC++book} have championed the M:N user-threading model, and many user-threading libraries have appeared~\cite{Qthreads,MPC,Marcel}, including putting green threads back into Java~\cite{Quasar}.
    314 The main argument for user-level threading is that they are lighter weight than kernel threads (locking and context switching do not cross the kernel boundary), so there is less restriction on programming styles that encourage large numbers of threads performing medium work units to facilitate load balancing by the runtime~\cite{Verch12}.
     320The main argument for user-level threading is that it is lighter weight than kernel threading (locking and context switching do not cross the kernel boundary), so there is less restriction on programming styles that encourage large numbers of threads performing medium work units to facilitate load balancing by the runtime~\cite{Verch12}.
    315321As well, user-threading facilitates a simpler concurrency approach using thread objects that leverage sequential patterns versus events with call-backs~\cite{Adya02,vonBehren03}.
    316322Finally, performant user-threading implementations (both time and space) meet or exceed direct kernel-threading implementations, while achieving the programming advantages of high concurrency levels and safety.
     
    669675In contrast, the execution state is large, with one @resume@ and seven @suspend@s.
    670676Hence, the key benefits of the generator are correctness, safety, and maintenance because the execution states are transcribed directly into the programming language rather than using a table-driven approach.
    671 Because FSMs can be complex and frequently occur in important domains, direct support of the generator is crucial in a system programming language.
     677Because FSMs can be complex and frequently occur in important domains, direct generator support is important in a system programming language.
    672678
    673679\begin{figure}
     
    796802This semantics is basically a tail-call optimization, which compilers already perform.
    797803The example shows the assembly code to undo the generator's entry code before the direct jump.
    798 This assembly code depends on what entry code is generated, specifically if there are local variables, and the level of optimization.
     804This assembly code depends on what entry code is generated, specifically if there are local variables and the level of optimization.
    799805To provide this new calling convention requires a mechanism built into the compiler, which is beyond the scope of \CFA at this time.
    800806Nevertheless, it is possible to hand generate any symmetric generators for proof of concept and performance testing.
  • libcfa/prelude/builtins.c

    rb0ab7853 r256728f  
    1010// Created On       : Fri Jul 21 16:21:03 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Mar 26 23:10:36 2019
    13 // Update Count     : 95
     12// Last Modified On : Tue Jun 25 18:06:52 2019
     13// Update Count     : 97
    1414//
    1515
     
    4949void abort( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ ));
    5050
    51 // increment/decrement unification
     51// implicit increment, decrement if += defined, and implicit not if != defined
    5252
    5353static inline {
     
    6363        forall( dtype DT | sized(DT) | { void ?{}( DT &, DT ); void ^?{}( DT & ); DT & ?-=?( DT &, one_t ); } )
    6464        DT & ?--( DT & x ) { DT tmp = x; x -= 1; return tmp; }
     65
     66        forall( dtype DT | { int ?!=?( const DT &, zero_t ); } )
     67        int !?( const DT & x ) { return !( x != 0 ); }
    6568} // distribution
    6669
  • libcfa/src/bits/containers.hfa

    rb0ab7853 r256728f  
    99// Author           : Thierry Delisle
    1010// Created On       : Tue Oct 31 16:38:50 2017
    11 // Last Modified By : --
    12 // Last Modified On : --
    13 // Update Count     : 0
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Jun 26 08:52:20 2019
     13// Update Count     : 4
    1414
    1515#pragma once
     
    115115                }
    116116                return top;
     117        }
     118
     119        forall(dtype T | is_node(T))
     120        static inline int ?!=?( const __stack(T) & this, __attribute__((unused)) zero_t zero ) {
     121                return this.top != 0;
    117122        }
    118123#endif
     
    186191
    187192        forall(dtype T | is_node(T))
    188         static inline bool ?!=?( __queue(T) & this, __attribute__((unused)) zero_t zero ) {
     193        static inline int ?!=?( const __queue(T) & this, __attribute__((unused)) zero_t zero ) {
    189194                return this.head != 0;
    190195        }
     
    268273
    269274        forall(dtype T | sized(T))
    270         static inline bool ?!=?( __dllist(T) & this, __attribute__((unused)) zero_t zero ) {
     275        static inline int ?!=?( const __dllist(T) & this, __attribute__((unused)) zero_t zero ) {
    271276                return this.head != 0;
    272277        }
  • libcfa/src/stdlib.cfa

    rb0ab7853 r256728f  
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 12 08:03:59 2018
    13 // Update Count     : 458
     12// Last Modified On : Mon Jun 24 17:34:44 2019
     13// Update Count     : 462
    1414//
    1515
     
    6565forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } )
    6666T * anew( size_t dim, Params p ) {
    67         T *arr = alloc( dim );
     67        T * arr = alloc( dim );
    6868        for ( unsigned int i = 0; i < dim; i += 1 ) {
    6969                (arr[i]){ p };                                                                  // run constructor
  • tests/.expect/completeTypeError.txt

    rb0ab7853 r256728f  
    2727    void
    2828  )
    29   Environment:( _82_4_DT ) -> instance of struct A with body 0 (no widening)
     29  Environment:( _83_4_DT ) -> instance of struct A with body 0 (no widening)
    3030
    3131
     
    5050    void
    5151  )
    52   Environment:( _82_4_DT ) -> instance of struct B with body 1 (no widening)
     52  Environment:( _83_4_DT ) -> instance of struct B with body 1 (no widening)
    5353
    5454
     
    127127          void
    128128        )
    129         Environment:( _101_0_T ) -> instance of type T (not function type) (no widening)
     129        Environment:( _102_0_T ) -> instance of type T (not function type) (no widening)
    130130
    131131      Could not satisfy assertion:
    132132?=?: pointer to function
    133133        ... with parameters
    134           reference to instance of type _101_0_T (not function type)
    135           instance of type _101_0_T (not function type)
     134          reference to instance of type _102_0_T (not function type)
     135          instance of type _102_0_T (not function type)
    136136        ... returning
    137           _retval__operator_assign: instance of type _101_0_T (not function type)
     137          _retval__operator_assign: instance of type _102_0_T (not function type)
    138138          ... with attributes:
    139139            Attribute with name: unused
Note: See TracChangeset for help on using the changeset viewer.