Changeset e71e94a


Ignore:
Timestamp:
Apr 1, 2022, 1:47:47 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
5f53cc3
Parents:
1417f6b
Message:

Some clean-up of ready queue usage of -1llu.
io types ts now returns MAX on empty cq

Location:
libcfa/src/concurrency
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/io/types.hfa

    r1417f6b re71e94a  
    2525#include "iofwd.hfa"
    2626#include "kernel/fwd.hfa"
     27#include "limits.hfa"
    2728
    2829#if defined(CFA_HAVE_LINUX_IO_URING_H)
     
    136137
    137138        static inline unsigned long long ts($io_context *& this) {
     139                const __u32 head = *this->cq.head;
     140                const __u32 tail = *this->cq.tail;
     141
     142                if(head == tail) return MAX;
     143
    138144                return this->cq.ts;
    139145        }
  • libcfa/src/concurrency/ready_subqueue.hfa

    r1417f6b re71e94a  
    33#define __CFA_NO_SCHED_STATS__
    44
    5 #include "containers/queueLockFree.hfa"
     5#include "limits.hfa"
    66
    77// Intrusives lanes which are used by the relaxed ready queue
     
    3232        /* paranoid */ verify( this.lock );
    3333        /* paranoid */ verify( node->link.next == 0p );
    34         /* paranoid */ verify( node->link.ts   == -1llu  );
     34        /* paranoid */ verify( node->link.ts   == MAX  );
    3535        /* paranoid */ verify( this.prev->link.next == 0p );
    36         /* paranoid */ verify( this.prev->link.ts   == -1llu  );
     36        /* paranoid */ verify( this.prev->link.ts   == MAX  );
    3737        if( this.anchor.next == 0p ) {
    3838                /* paranoid */ verify( this.anchor.next == 0p );
    39                 /* paranoid */ verify( this.anchor.ts   == -1llu );
     39                /* paranoid */ verify( this.anchor.ts   == MAX );
    4040                /* paranoid */ verify( this.anchor.ts   != 0  );
    4141                /* paranoid */ verify( this.prev == mock_head( this ) );
    4242        } else {
    4343                /* paranoid */ verify( this.anchor.next != 0p );
    44                 /* paranoid */ verify( this.anchor.ts   != -1llu );
     44                /* paranoid */ verify( this.anchor.ts   != MAX );
    4545                /* paranoid */ verify( this.anchor.ts   != 0  );
    4646                /* paranoid */ verify( this.prev != mock_head( this ) );
     
    6262        /* paranoid */ verify( this.lock );
    6363        /* paranoid */ verify( this.anchor.next != 0p );
    64         /* paranoid */ verify( this.anchor.ts   != -1llu );
     64        /* paranoid */ verify( this.anchor.ts   != MAX );
    6565        /* paranoid */ verify( this.anchor.ts   != 0  );
    6666
     
    7171        bool is_empty = this.anchor.next == 0p;
    7272        node->link.next = 0p;
    73         node->link.ts   = -1llu;
     73        node->link.ts   = MAX;
    7474        #if !defined(__CFA_NO_STATISTICS__)
    7575                this.cnt--;
     
    8080
    8181        /* paranoid */ verify( node->link.next == 0p );
    82         /* paranoid */ verify( node->link.ts   == -1llu  );
     82        /* paranoid */ verify( node->link.ts   == MAX  );
    8383        /* paranoid */ verify( node->link.ts   != 0  );
    8484        /* paranoid */ verify( this.anchor.ts  != 0  );
Note: See TracChangeset for help on using the changeset viewer.