implemented jsc::event_counter, jsc::spin_mutex, jsc::forward_as<>, jsc::invoke and jsc::atomic_wait() #3

Merged
i.kabadshow merged 7 commits from m.zych/jsc-cxx:main into main 2024-01-16 22:26:27 +01:00
Member
No description provided.
The jsc::event_counter allows signalling occurrences of events
and detecting when the desired number of events have happened.

It can be used as a dependency counter to detect when
the last dependent task has finished executing,
thus making the subsequent task ready to be scheduled for execution.

  +------+   +------+    +------+
  |task A|   |task B|    |task A|
  +------+   +------+    +------+
      |         |            |
      v         v            v
   -----------------      -----------------      -----------------
   |event_counter=2|      |event_counter=1|      |event_counter=0|
   -----------------      -----------------      -----------------
           |                      |                      |
           v                      v                      v
        +------+               +------+               +------+
        |task C|               |task C|               |task C|
        +------+               +------+               +------+
------------------------------------------------------------------> time
In short, the jsc::forward_as<type> auto&& represents
a forwarding reference bound to a specific / concrete type.
The jsc::atomic_wait() will block the current thread of execution
until the value of the std::atomic<> has changed to the new_value.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: ATML-CAP/jsc-cxx#3
No description provided.