Changes in / [d4da1535:edf247b]


Ignore:
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/io.cfa

    rd4da1535 redf247b  
    635635
    636636                        // We can proceed to the fast path
    637                         if( !__alloc(ctx, &idx, 1) ) {
    638                                 /* paranoid */ verify( false ); // for now check if this happens, next time just abort the sleep.
    639                                 return false;
    640                         }
     637                        if( !__alloc(ctx, &idx, 1) ) return false;
    641638
    642639                        // Allocation was successful
     
    668665
    669666                        /* paranoid */ verify( sqe->user_data == (uintptr_t)&future );
    670                         __submit_only( ctx, &idx, 1 );
     667                        __submit( ctx, &idx, 1, true );
    671668
    672669                        /* paranoid */ verify( proc == __cfaabi_tls.this_processor );
     
    679676                        iovec iov;
    680677                        __atomic_acquire( &proc->io.ctx->cq.lock );
    681 
    682                         __attribute__((used)) volatile bool was_reset = false;
    683678
    684679                        with( proc->idle_wctx) {
     
    692687                                        iov.iov_len  = sizeof(eventfd_t);
    693688                                        __kernel_read(proc, *ftr, iov, evfd );
    694                                         ftr->result = 0xDEADDEAD;
    695                                         *((eventfd_t *)rdbuf) = 0xDEADDEADDEADDEAD;
    696                                         was_reset = true;
    697689                                }
    698690                        }
    699691
    700                         if( !__atomic_load_n( &proc->do_terminate, __ATOMIC_SEQ_CST ) ) {
    701                                 __ioarbiter_flush( *proc->io.ctx );
    702                                 proc->idle_wctx.sleep_time = rdtscl();
    703                                 ioring_syscsll( *proc->io.ctx, 1, IORING_ENTER_GETEVENTS);
    704                         }
     692                        __ioarbiter_flush( *proc->io.ctx );
     693                        ioring_syscsll( *proc->io.ctx, 1, IORING_ENTER_GETEVENTS);
    705694
    706695                        ready_schedule_lock();
    707696                        __cfa_do_drain( proc->io.ctx, proc->cltr );
    708697                        ready_schedule_unlock();
    709 
    710                         asm volatile ("" :: "m" (was_reset));
    711698                }
    712699        #endif
  • libcfa/src/concurrency/kernel.cfa

    rd4da1535 redf247b  
    682682        this->idle_wctx.sem = 1;
    683683
    684         this->idle_wctx.wake_time = rdtscl();
    685 
    686684        eventfd_t val;
    687685        val = 1;
  • libcfa/src/concurrency/kernel.hfa

    rd4da1535 redf247b  
    7474        // unused if not using io_uring for idle sleep
    7575        io_future_t * ftr;
    76 
    77         volatile unsigned long long wake_time;
    78         volatile unsigned long long sleep_time;
    7976};
    8077
  • libcfa/src/concurrency/kernel/startup.cfa

    rd4da1535 redf247b  
    558558
    559559        idle_wctx.sem = 0;
    560         idle_wctx.wake_time = 0;
    561560
    562561        // I'm assuming these two are reserved for standard input and output
  • src/AST/Convert.cpp

    rd4da1535 redf247b  
    27172717
    27182718                for (auto & param : foralls) {
    2719                         ty->forall.emplace_back(new ast::TypeInstType(param));
     2719                        ty->forall.emplace_back(new ast::TypeInstType(param->name, param));
    27202720                        for (auto asst : param->assertions) {
    27212721                                ty->assertions.emplace_back(new ast::VariableExpr({}, asst));
  • src/AST/Decl.cpp

    rd4da1535 redf247b  
    6868        }
    6969        for (auto & tp : this->type_params) {
    70                 ftype->forall.emplace_back(new TypeInstType(tp));
     70                ftype->forall.emplace_back(new TypeInstType(tp->name, tp));
    7171                for (auto & ap: tp->assertions) {
    7272                        ftype->assertions.emplace_back(new VariableExpr(loc, ap));
  • src/AST/Type.cpp

    rd4da1535 redf247b  
    147147// --- TypeInstType
    148148
    149 TypeInstType::TypeInstType( const TypeDecl * b,
    150         CV::Qualifiers q, std::vector<ptr<Attribute>> && as )
    151 : BaseInstType( b->name, q, move(as) ), base( b ), kind( b->kind ) {}
    152 
    153149void TypeInstType::set_base( const TypeDecl * b ) {
    154150        base = b;
  • src/AST/Type.hpp

    rd4da1535 redf247b  
    421421                std::vector<ptr<Attribute>> && as = {} )
    422422        : BaseInstType( n, q, std::move(as) ), base( b ), kind( b->kind ) {}
    423 
    424         TypeInstType( const TypeDecl * b,
    425                 CV::Qualifiers q = {}, std::vector<ptr<Attribute>> && as = {} );
    426 
    427423        TypeInstType( const std::string& n, TypeDecl::Kind k, CV::Qualifiers q = {},
    428424                std::vector<ptr<Attribute>> && as = {} )
  • src/Concurrency/KeywordsNew.cpp

    rd4da1535 redf247b  
    8888                auto typeDecl = ast::deepCopy( typeParam );
    8989                mutFunc->type_params.push_back( typeDecl );
    90                 mutType->forall.push_back( new ast::TypeInstType( typeDecl ) );
     90                mutType->forall.push_back(
     91                        new ast::TypeInstType( typeDecl->name, typeDecl ) );
    9192                for ( auto & assertion : typeDecl->assertions ) {
    9293                        mutFunc->assertions.push_back( assertion );
     
    107108        for ( const ast::ptr<ast::TypeDecl> & typeDecl : mutFunc->type_params ) {
    108109                paramTypeInst->params.push_back(
    109                         new ast::TypeExpr( location, new ast::TypeInstType( typeDecl ) ) );
     110                        new ast::TypeExpr( location,
     111                                new ast::TypeInstType( typeDecl->name, typeDecl ) ) );
    110112                typeParamInst->params.push_back(
    111                         new ast::TypeExpr( location, new ast::TypeInstType( typeDecl ) ) );
     113                        new ast::TypeExpr( location,
     114                                new ast::TypeInstType( typeDecl->name, typeDecl ) ) );
    112115        }
    113116
  • src/ResolvExpr/Resolver.cc

    rd4da1535 redf247b  
    13851385                        for (auto & typeParam : mutDecl->type_params) {
    13861386                                symtab.addType(typeParam);
    1387                                 mutType->forall.emplace_back(new ast::TypeInstType(typeParam));
     1387                                mutType->forall.emplace_back(new ast::TypeInstType(typeParam->name, typeParam));
    13881388                        }
    13891389                        for (auto & asst : mutDecl->assertions) {
  • src/Validate/Autogen.cpp

    rd4da1535 redf247b  
    248248                structInst.params.push_back( new ast::TypeExpr(
    249249                        typeDecl->location,
    250                         new ast::TypeInstType( typeDecl )
     250                        new ast::TypeInstType( typeDecl->name, typeDecl )
    251251                ) );
    252252        }
     
    264264                unionInst.params.push_back( new ast::TypeExpr(
    265265                        unionDecl->location,
    266                         new ast::TypeInstType( typeDecl )
     266                        new ast::TypeInstType( typeDecl->name, typeDecl )
    267267                ) );
    268268        }
  • src/Validate/ForallPointerDecay.cpp

    rd4da1535 redf247b  
    4141        for ( auto & type_param : decl->type_params ) {
    4242                type->forall.emplace_back(
    43                         new ast::TypeInstType( type_param ) );
     43                        new ast::TypeInstType( type_param->name, type_param ) );
    4444        }
    4545        for ( auto & assertion : decl->assertions ) {
Note: See TracChangeset for help on using the changeset viewer.