Ignore:
File:
1 edited

Legend:

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

    r16fd826 rf302d80  
    1111        // spin lock protecting the queue
    1212        volatile bool lock;
    13 
    14         #if !defined(__CFA_NO_STATISTICS__)
    15                 unsigned cnt;
    16         #endif
    1713
    1814        __thread_desc_link anchor;
     
    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) );
     
    6254// returns true of lane was empty before push, false otherwise
    6355static inline void push( __intrusive_lane_t & this, $thread * node ) {
    64         /* paranoid */ verify( this.lock );
    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
     
    9078// returns true of lane was empty before push, false otherwise
    9179static inline [* $thread, unsigned long long] pop( __intrusive_lane_t & this ) {
    92         /* paranoid */ verify( this.lock );
    9380        /* paranoid */ verify( this.anchor.next != 0p );
    9481        /* paranoid */ verify( this.anchor.ts   != 0  );
     
    10289        node->link.next = 0p;
    10390        node->link.ts   = 0;
    104         #if !defined(__CFA_NO_STATISTICS__)
    105                 this.cnt--;
    106         #endif
    10791
    10892        // Update head time stamp
     
    124108        return this.anchor.ts;
    125109}
     110
     111// Aligned timestamps which are used by the relaxed ready queue
     112struct __attribute__((aligned(128))) __timestamp_t {
     113        volatile unsigned long long tv;
     114};
     115
     116void  ?{}(__timestamp_t & this) { this.tv = 0; }
     117void ^?{}(__timestamp_t & this) {}
Note: See TracChangeset for help on using the changeset viewer.