-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scheduler hints and fixes for distributed coordination bugs (#169)
* Started fixes for locks * Clearing up groups * Experiments with waiters/ maps * Add test for flag waiter * Avoid scheduling multiple threads on same thread as 0th group * Overloading thread pool * Moved unrelated changes to separate PR * Add locks.cpp * Only lock on group when it exists * Add custom merges * Overhaul of snapshot diffing * Move spurious logging statement * More snapshotting fixes * Rearrange scheduler logic * Fix indexing in scheduler loop * Avoid pushing snapshots to master host * Remove last snapshot stuff * Add scheduler hints * Fix bug in host ordering * Sort out reusing ptp messages * Naming * Fixing up tests * Continuing test fixes * Remove ignore regions * Add distributed locking test * Formatting * Fix dist tests and remove unnecessary unit test * Clearer error message when insufficient pool threads * Bump cores in failing tests * Factor out scheduler decision making * Fix locking bug
- Loading branch information
Showing
25 changed files
with
1,553 additions
and
1,076 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,33 @@ | ||
#pragma once | ||
|
||
#include <faabric/util/logging.h> | ||
|
||
#include <atomic> | ||
#include <condition_variable> | ||
#include <mutex> | ||
#include <shared_mutex> | ||
|
||
#define DEFAULT_FLAG_WAIT_MS 10000 | ||
|
||
namespace faabric::util { | ||
typedef std::unique_lock<std::mutex> UniqueLock; | ||
typedef std::unique_lock<std::shared_mutex> FullLock; | ||
typedef std::shared_lock<std::shared_mutex> SharedLock; | ||
|
||
class FlagWaiter | ||
{ | ||
public: | ||
FlagWaiter(int timeoutMsIn = DEFAULT_FLAG_WAIT_MS); | ||
|
||
void waitOnFlag(); | ||
|
||
void setFlag(bool value); | ||
|
||
private: | ||
int timeoutMs; | ||
|
||
std::mutex flagMx; | ||
std::condition_variable cv; | ||
std::atomic<bool> flag; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.