Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/ready_subqueue.hfa

    r353aaba rd3ba775  
    1313
    1414        __thread_desc_link anchor;
    15 
    16         #if !defined(__CFA_NO_STATISTICS__)
    17                 unsigned cnt;
    18         #endif
    1915};
    2016
     
    3329        this.anchor.next = 0p;
    3430        this.anchor.ts   = 0;
    35         #if !defined(__CFA_NO_STATISTICS__)
    36                 this.cnt  = 0;
    37         #endif
    3831
    3932        // We add a boat-load of assertions here because the anchor code is very fragile
    40         /* paranoid */ _Static_assert( offsetof( $thread, link ) == offsetof(__intrusive_lane_t, anchor) );
    4133        /* paranoid */ verify( offsetof( $thread, link ) == offsetof(__intrusive_lane_t, anchor) );
    4234        /* paranoid */ verify( ((uintptr_t)( mock_head(this) ) + offsetof( $thread, link )) == (uintptr_t)(&this.anchor) );
     
    6153// Push a thread onto this lane
    6254// returns true of lane was empty before push, false otherwise
    63 static inline void push( __intrusive_lane_t & this, $thread * node ) {
    64         /* paranoid */ verify( this.lock );
     55void push( __intrusive_lane_t & this, $thread * node ) {
    6556        /* paranoid */ verify( node->link.next == 0p );
    6657        /* paranoid */ verify( node->link.ts   == 0  );
     
    8172        this.prev->link.ts   = rdtscl();
    8273        this.prev = node;
    83         #if !defined(__CFA_NO_STATISTICS__)
    84                 this.cnt++;
    85         #endif
    8674}
    8775
     
    8977// returns popped
    9078// returns true of lane was empty before push, false otherwise
    91 static inline [* $thread, unsigned long long] pop( __intrusive_lane_t & this ) {
    92         /* paranoid */ verify( this.lock );
     79$thread * pop( __intrusive_lane_t & this ) {
    9380        /* paranoid */ verify( this.anchor.next != 0p );
    9481        /* paranoid */ verify( this.anchor.ts   != 0  );
    9582
    9683        // Get the relevant nodes locally
    97         unsigned long long ts = this.anchor.ts;
    9884        $thread * node = this.anchor.next;
    9985        this.anchor.next = node->link.next;
     
    10288        node->link.next = 0p;
    10389        node->link.ts   = 0;
    104         #if !defined(__CFA_NO_STATISTICS__)
    105                 this.cnt--;
    106         #endif
    10790
    10891        // Update head time stamp
     
    11194        /* paranoid */ verify( node->link.next == 0p );
    11295        /* paranoid */ verify( node->link.ts   == 0  );
    113         return [node, ts];
     96        return node;
    11497}
    11598
     
    124107        return this.anchor.ts;
    125108}
     109
     110// Aligned timestamps which are used by the relaxed ready queue
     111struct __attribute__((aligned(128))) __timestamp_t {
     112        volatile unsigned long long tv;
     113};
     114
     115void  ?{}(__timestamp_t & this) { this.tv = 0; }
     116void ^?{}(__timestamp_t & this) {}
Note: See TracChangeset for help on using the changeset viewer.