Ignore:
Timestamp:
Apr 26, 2018, 5:23:15 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
b9f383f
Parents:
22bdc34
Message:

Implemented clusters and added many constructors for threads/coroutines/processors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/kernel

    r22bdc34 rde6319f  
    4848        __queue_t(thread_desc) ready_queue;
    4949
     50        // Name of the cluster
     51        const char * name;
     52
    5053        // Preemption rate on this cluster
    5154        Duration preemption_rate;
    5255};
    5356
     57extern struct cluster * mainCluster;
    5458extern Duration default_preemption();
    5559
    56 void ?{} (cluster & this);
     60void ?{} (cluster & this, const char * name, Duration preemption_rate);
    5761void ^?{}(cluster & this);
     62
     63static inline void ?{} (cluster & this)                           { this{"Anonymous Cluster", default_preemption()}; }
     64static inline void ?{} (cluster & this, Duration preemption_rate) { this{"Anonymous Cluster", preemption_rate}; }
     65static inline void ?{} (cluster & this, const char * name)        { this{name, default_preemption()}; }
    5866
    5967//-----------------------------------------------------------------------------
     
    92100        cluster * cltr;
    93101
     102        // Name of the processor
     103        const char * name;
     104
    94105        // Handle to pthreads
    95106        pthread_t kernel_thread;
     
    119130};
    120131
    121 void  ?{}(processor & this);
    122 void  ?{}(processor & this, cluster * cltr);
     132void  ?{}(processor & this, const char * name, cluster & cltr);
    123133void ^?{}(processor & this);
     134
     135static inline void  ?{}(processor & this)                    { this{ "Anonymous Processor", *mainCluster}; }
     136static inline void  ?{}(processor & this, cluster & cltr)    { this{ "Anonymous Processor", cltr}; }
     137static inline void  ?{}(processor & this, const char * name) { this{name, *mainCluster }; }
    124138
    125139// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.