Ignore:
Timestamp:
Apr 19, 2022, 3:00:04 PM (3 years ago)
Author:
m3zulfiq <m3zulfiq@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
5b84a321
Parents:
ba897d21 (diff), bb7c77d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

added benchmark and evaluations chapter to thesis

File:
1 edited

Legend:

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

    rba897d21 r2e9b59b  
    2323#include "bits/locks.hfa"
    2424#include "bits/queue.hfa"
     25#include "iofwd.hfa"
    2526#include "kernel/fwd.hfa"
     27#include "limits.hfa"
    2628
    2729#if defined(CFA_HAVE_LINUX_IO_URING_H)
     
    7779
    7880        struct __cmp_ring_t {
     81                volatile bool lock;
     82
     83                unsigned id;
     84
     85                unsigned long long ts;
     86
    7987                // Head and tail of the ring
    8088                volatile __u32 * head;
     
    128136        };
    129137
     138        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
     144                return this->cq.ts;
     145        }
     146
    130147        struct __pending_alloc {
    131148                inline __outstanding_io;
     
    170187        // void __ioctx_prepare_block($io_context & ctx);
    171188#endif
    172 
    173 //-----------------------------------------------------------------------
    174 // IO user data
    175 struct io_future_t {
    176         future_t self;
    177         __s32 result;
    178 };
    179 
    180 static inline {
    181         thread$ * fulfil( io_future_t & this, __s32 result, bool do_unpark = true ) {
    182                 this.result = result;
    183                 return fulfil(this.self, do_unpark);
    184         }
    185 
    186         // Wait for the future to be fulfilled
    187         bool wait     ( io_future_t & this ) { return wait     (this.self); }
    188         void reset    ( io_future_t & this ) { return reset    (this.self); }
    189         bool available( io_future_t & this ) { return available(this.self); }
    190 }
Note: See TracChangeset for help on using the changeset viewer.