Ignore:
Timestamp:
Apr 27, 2017, 2:00:07 PM (8 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, resolv-new, with_gc
Children:
f80ab45
Parents:
e464759
Message:

Implementation of internal scheduling in CFA

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/monitor

    re464759 r0c78741  
    4646//-----------------------------------------------------------------------------
    4747// Internal scheduling
     48
     49struct __condition_criterion_t {
     50        bool ready;                                             //Whether or not the criterion is met (True if met)
     51        monitor_desc * target;                          //The monitor this criterion concerns
     52        struct __condition_node_t * owner;              //The parent node to which this criterion belongs
     53        __condition_criterion_t * next;         //Intrusive linked list Next field
     54};
     55
     56struct __condition_node_t {
     57        thread_desc * waiting_thread;                   //Thread that needs to be woken when all criteria are met
     58        __condition_criterion_t * criteria;     //Array of criteria (Criterions are contiguous in memory)
     59        unsigned short count;                           //Number of criterions in the criteria
     60        __condition_node_t * next;                      //Intrusive linked list Next field
     61};
     62
     63struct __condition_blocked_queue_t {
     64        __condition_node_t * head;
     65        __condition_node_t ** tail;
     66};
     67
     68void ?{}( __condition_blocked_queue_t * );
     69void append( __condition_blocked_queue_t *, __condition_node_t * );
     70__condition_node_t * pop_head( __condition_blocked_queue_t * );
     71
    4872struct condition {
    49         __thread_queue_t blocked;
    50         monitor_desc ** monitors;
    51         unsigned short monitor_count;
     73        __condition_blocked_queue_t blocked;    //Link list which contains the blocked threads as-well as the information needed to unblock them
     74        monitor_desc ** monitors;                       //Array of monitor pointers (Monitors are NOT contiguous in memory)
     75        unsigned short monitor_count;                   //Number of monitors in the array
    5276};
    5377
Note: See TracChangeset for help on using the changeset viewer.