Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Restructure how we do sync / waits #153

Merged
merged 2 commits into from
Nov 5, 2023
Merged

Commits on Oct 30, 2023

  1. feat: Restructure how we do sync / waits

    The big issue we have right now is that we're limited by the "slots" a counter has. Either users are stuck with the "base" 4 slots, or they have to dynamically allocate to get more. Which is also fragile for the user to know beforehand.
    
    The core realization of this change is that any time a fiber is waiting (IE it needs to be in the counter's queue), it's "asleep", and we can guarantee the stack memory is valid. So instead of the *counter* allocating memory, we allocate memory on the stack for the wait, and use a linked list to store the "queue" of waiting fibers.
    
    BREAKING CHANGE: This removes AtomicCounter, TaskCounter, and AtomicFlag. And replaces them with WaitGroup. WaitGroup functions very similarly to TaskCounter, but users no longer need to worry about how many "waiting fiber slots" they need. Fibtex is also restructured. It's no longer possible to configure the "lock behavior"
    RichieSams committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    b3cb9fa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    880fbbf View commit details
    Browse the repository at this point in the history