Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
a03a8a0
NG: Fix AV in UI for deleted links.
linuscu Jun 26, 2025
202a2e9
NG: Simplify ma filter.
linuscu Jun 26, 2025
85e68bc
NG: Add filter test.
linuscu Jun 27, 2025
41bca46
NG: Fix potential recursion overflow.
linuscu Jun 29, 2025
dd1d801
NG: Fix error.
linuscu Jun 30, 2025
498c5b4
NG: Add text editing to text .
linuscu Jul 8, 2025
219ce43
Add glfw char input for text editing.
linuscu Jul 8, 2025
3f4e31d
NG: Use imgui character input io since dockable windows wont work wit…
linuscu Jul 8, 2025
ec1702c
NG: Make some text input fields editable.
linuscu Jul 8, 2025
bae735f
NG: Fix name.
linuscu Jul 8, 2025
589346a
Minor fixes.
linuscu Jul 9, 2025
5c69598
Add size param to node creator so we save that to json as well.
linuscu Jul 9, 2025
3daea10
NG: Add node pow and level trigger. Fix node size on loading from jso…
linuscu Jul 10, 2025
7426b06
NG: Take input range in level trigger node.
linuscu Jul 10, 2025
6c0eb3b
NG: Split up aritmetic nodes.
linuscu Jul 10, 2025
faabeff
Test no web socket auto ping and raw mode more easily with documentat…
linuscu Jul 13, 2025
e073dab
Remove some error checking that caused missing data.
linuscu Jul 16, 2025
ccc091d
Zero memory properly so string_buffer also work with cstrings.
linuscu Jul 16, 2025
86e4b5a
Network: Check curl handle in all exposed api functions.
linuscu Jul 19, 2025
591a321
Math: Add logx conversion function.
linuscu Jul 19, 2025
e1806ce
Network: Add auto reconnect state to websockets.
linuscu Jul 19, 2025
c432400
Storage: Fix some issues with sequential cache.
linuscu Jul 19, 2025
52c0baf
NG: Remove destructor logging.
linuscu Jul 20, 2025
1f9fd12
Add delete functions for persistent cache.
linuscu Jul 21, 2025
a1060d3
Storage+Network: Fix unpersist in sequencial cache. Also added a prot…
linuscu Jul 21, 2025
bc442db
Network: Add logging prefix.
linuscu Jul 21, 2025
6c348cb
Network: Do not log errors liberally. No keepalive logging.
linuscu Jul 22, 2025
beb59ce
NG: Add output float/test setters.
linuscu Jul 24, 2025
6c478c8
NG: Add chart info node.
linuscu Jul 24, 2025
e378723
NG: Fix chart info node.
linuscu Jul 24, 2025
7920807
Websocket: default to autoping.
linuscu Jul 25, 2025
6eca0bd
NG: Add numerical minmax channel.
linuscu Jul 25, 2025
a434418
Add another binary searcher for less or equal values.
linuscu Jul 26, 2025
5c66c09
Math: Accept bounds in search.
linuscu Jul 26, 2025
2556260
Fix minmax channel writing.
linuscu Jul 26, 2025
7d8cb04
Add fixed point math and test.
linuscu Jul 30, 2025
0953f7e
Fix a few more fixed point edge cases.
linuscu Aug 1, 2025
e6f68d5
Math: Fix fixed point implementation.
linuscu Aug 2, 2025
4f35ebf
Math: add fp multiplication.
linuscu Aug 2, 2025
07baac3
logging: add empty string buffer check.
linuscu Aug 3, 2025
280a2f0
NG: Add combined diff+int+add+scale node.
linuscu Aug 3, 2025
3115a48
Fix some node names and value edit. Add ui markers and a reconstruct …
linuscu Aug 4, 2025
f0818a1
Fix some bugs.
linuscu Aug 4, 2025
4655117
Fix error.
linuscu Aug 4, 2025
0824e24
Update cmake-multi-platform.yml
lnd3 Aug 4, 2025
75f22e4
Change default build path for ldeps when building standalone.
linuscu Aug 4, 2025
26fbe4d
Merge branch 'version-0.1.8' of github.com:lnd3/ltools into version-0…
linuscu Aug 4, 2025
2f0382b
Update cmake-multi-platform.yml
lnd3 Aug 4, 2025
809a2af
Update cmake-multi-platform.yml
lnd3 Aug 4, 2025
3edf228
Revert ldeps path.
linuscu Aug 4, 2025
b9f8308
Merge branch 'version-0.1.8' of github.com:lnd3/ltools into version-0…
linuscu Aug 4, 2025
4e54c4b
Update cmake-multi-platform.yml
lnd3 Aug 4, 2025
266d624
Update cmake-multi-platform.yml
lnd3 Aug 4, 2025
02a61c7
Fix error.
linuscu Aug 5, 2025
6390c5b
Add rolling sum for ui chart marker node.
linuscu Aug 5, 2025
672142e
NG: Use to change factor in chart marker.
linuscu Aug 5, 2025
0fab51f
NG:Add beep for chart markers.
linuscu Aug 5, 2025
3e67adf
NG: marker chart changes.
linuscu Aug 6, 2025
ee8adc5
NG: Fix start condition.
linuscu Aug 6, 2025
79906d9
Split up conditions and also fix unix build error.
linuscu Aug 7, 2025
db80e1a
No need to check for nan if we reset every new round.
linuscu Aug 7, 2025
2df96ce
NG: Fix custom input to math nodes. Remove asserts on some string op.
linuscu Aug 10, 2025
17bbe76
Simplify order node.
linuscu Aug 12, 2025
f4b620c
Fix bad default values.
linuscu Aug 13, 2025
da693dd
Remove unused code.
linuscu Aug 14, 2025
67f295d
NG: marker ui node and simple trade tracking.
linuscu Aug 16, 2025
461a016
NG: Fix warning.
linuscu Aug 16, 2025
6967540
Add current time to chart info.
linuscu Aug 17, 2025
eedf3d8
Fix sorted vector.
linuscu Aug 18, 2025
f8cfacd
Fix padding in to time string buffer.
linuscu Aug 18, 2025
0512fe6
Add some more functions to sorted vector.
linuscu Aug 19, 2025
95cebd8
Add ochlv ma source.
linuscu Aug 19, 2025
fd8ef52
NG: Fix up ochlv ma.
linuscu Aug 19, 2025
082c0a6
NG: Integrate timeframe option in standard ochlv in data node.
linuscu Aug 20, 2025
423cdf1
NG: Fix some issue with trade nodes.
linuscu Aug 21, 2025
98047dd
NG: Add tooltip in node picker for node descriptions.
linuscu Aug 22, 2025
2e913c9
Enable unity builds for most projects. Update ldeps unity builds.
linuscu Aug 22, 2025
ff6b306
Merge branch 'version-0.1.8' of github.com:lnd3/ltools into version-0…
linuscu Aug 22, 2025
1a1b397
Also exclude math_test from unity build.
linuscu Aug 22, 2025
0ebad25
Fix linux warning.
linuscu Aug 22, 2025
523014e
Make tests more unique (with __counter__) and also make them static t…
linuscu Aug 22, 2025
60d439c
Reenable some projects that work with the new changes in test suite.
linuscu Aug 22, 2025
e1d9a4b
Clean up picker tooltip. Add a few node descriptions.
linuscu Aug 23, 2025
6d92cff
NG: Add two more util node ops.
linuscu Aug 24, 2025
addedf2
Some fixes.
linuscu Aug 25, 2025
20aa863
NG: Fix error in ochlv reset state.
linuscu Aug 25, 2025
cf69a1f
NG: Add a numerical trend node.
linuscu Aug 26, 2025
da02412
NG: Add trends node.
linuscu Aug 26, 2025
04c78af
NG: Change name of filter trends to reconstructor2. Add ATR node. Add…
linuscu Aug 28, 2025
657468e
NG: Fix some errors.
linuscu Aug 28, 2025
f2ffa4a
NG: Change normalizer to sigmoid to map input to unit area.
linuscu Aug 28, 2025
1452d59
NG: Change sigmoid to unitmap and remap to -1,1 interval.
linuscu Aug 28, 2025
717b712
NG: Add ema node. Fix some reset errors.
linuscu Sep 1, 2025
8195d9f
Add nn.lib with a fann test project.
linuscu Sep 4, 2025
8da622e
Merge branch 'version-0.1.8' of github.com:lnd3/ltools into version-0…
linuscu Sep 4, 2025
294496d
Add tiny-dnn test. Fix issues with tinydnn.
linuscu Sep 5, 2025
8581a0a
NN: Fix tinydnn integration.
linuscu Sep 6, 2025
714722c
Fix error.
linuscu Sep 6, 2025
7dbcf7d
NN: Fix some build warnings. Clarify node description.
linuscu Sep 7, 2025
86b86fb
NG: Better description.
linuscu Sep 7, 2025
f75e962
Fix error.
linuscu Sep 7, 2025
4203537
NG: Add minmax nodes. Add a simple temporal change node.
linuscu Sep 7, 2025
a8023e6
NG: Add chart line node for 2 and 3 interleaved lines.
linuscu Sep 8, 2025
83c2192
NG: Add div and minmax node. Fix descriptions.
linuscu Sep 14, 2025
81279a9
NG: Add an event handler for common node state changes.
linuscu Sep 16, 2025
3a82c94
Rename LOG -> LLOG because it has global name conflicts with some deps.
linuscu Sep 17, 2025
05a2d6c
Add torch to nn.
linuscu Sep 18, 2025
64ad8e0
Add torch test.
linuscu Sep 19, 2025
b09ff02
NG: Fix bug in pow node. Add simple event system for node group and n…
linuscu Oct 10, 2025
46a60c7
Add a mean exponential regression convolution node.
linuscu Oct 28, 2025
2a46963
Fix some issues.
linuscu Oct 28, 2025
8af18b1
Fix mean regression node.
linuscu Oct 28, 2025
b88a634
Change default bounds.
linuscu Oct 31, 2025
965abaa
UI: clarified what container is currently operated on in linkio visit…
linuscu Oct 31, 2025
2c7e978
Fix warning.
linuscu Nov 1, 2025
2dfaace
NG: Add some error handling and logging to schema parsing.
linuscu Nov 2, 2025
1af4fe5
NG: Better log info on node types, ids and channels.
linuscu Nov 2, 2025
3aa82a1
NG: Replace shift+ctrl for ctrl+alt.
linuscu Nov 3, 2025
d76b457
nn: Add so install for torch.
linuscu Nov 7, 2025
cb235df
Remove an assert.
linuscu Nov 8, 2025
c846c4f
Remove more asserts.
linuscu Nov 8, 2025
5109657
Readd some asserts. Extract a math helper infinity-to-positive-unit m…
linuscu Nov 9, 2025
f7afe68
Only use torch cuda lib.
linuscu Nov 10, 2025
5fabe2b
Fix libtorch wrapper.
linuscu Nov 12, 2025
99ba440
NG: Add a proper standard deviation node.
linuscu Nov 14, 2025
2b9c418
Fix minor issues.
linuscu Nov 14, 2025
f82fdb3
Add char checks for numeric and letter.
linuscu Nov 14, 2025
d144ffc
Add is numeric and is letter char functions.
linuscu Nov 14, 2025
e0f4de9
Fix error.
linuscu Nov 15, 2025
3fe7111
NG: Add sma node, remove zero quantization input.
linuscu Nov 16, 2025
37a5360
NG: Switch to deque in sma.
linuscu Nov 17, 2025
76e3d19
NG: Improve sma filter buffer.
linuscu Nov 17, 2025
d0ebe9c
Increase sma max size.
linuscu Nov 18, 2025
fbc7d15
Wrap torch related code in ifdef.
linuscu Nov 18, 2025
b3d790f
Fix sign.
linuscu Nov 18, 2025
46ee369
Remove semicolon.
linuscu Nov 18, 2025
c149ab3
Simplify uimodule base.
linuscu Nov 18, 2025
48bf2b1
Fix linux build warnings.
linuscu Nov 18, 2025
4345128
Remove unused code.
linuscu Nov 18, 2025
946e3b5
Fix incorrect log macro invocation.
linuscu Nov 18, 2025
8a858da
Remove uimodule as it has no use.
linuscu Nov 20, 2025
0e1513b
NG: Fix error in minmax compare.
linuscu Nov 21, 2025
a0d63dc
NG: Fix init problem.
linuscu Nov 22, 2025
2659288
Add flag manipulation functions. Add flag to sequential cache for bet…
linuscu Nov 22, 2025
d5e1678
Add methods for setting persist on destruction.
linuscu Nov 24, 2025
ba792bc
Make data on sequential cache blocks atomic.
linuscu Nov 24, 2025
f0b5881
NG: Fix init error.
linuscu Nov 24, 2025
e736589
NG: Add more flexibility.
linuscu Nov 27, 2025
368776b
NG: Add scaling to reversal in trend node.
linuscu Nov 29, 2025
d27fdef
Fix silly bug.
linuscu Dec 4, 2025
52461b7
Add buffer access to node graph input/output. Add general binary sear…
linuscu Dec 7, 2025
12a9d33
Fix missing cases.
linuscu Dec 9, 2025
6ea94d3
Fix error.
linuscu Dec 9, 2025
e5bec26
Remove std::to_string()
linuscu Dec 9, 2025
42aff40
Increase default buffer size in sequnce cache.
linuscu Dec 19, 2025
8b32739
Fix a bug in max3/min3.
linuscu Dec 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout deps/ldeps
uses: actions/checkout@v4
with:
repository: lnd3/ldeps
path: deps/ldeps
submodules: recursive
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
Expand All @@ -35,6 +41,12 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout deps/ldeps
uses: actions/checkout@v4
with:
repository: lnd3/ldeps
path: deps/ldeps
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get update
Expand Down
51 changes: 50 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ else()
filesystem
meta
memory
math
concurrency
serialization
crypto
math
audio
hid
nodegraph
nn

network
storage
Expand All @@ -43,4 +44,52 @@ else()


bs_configure_packages("packages" "${PACKAGE_NAMES}")

option(LTOOLS_ENABLE_UNITY_BUILD "Enable unity builds for faster compilation" OFF)
if(LTOOLS_ENABLE_UNITY_BUILD)
set_target_properties(logging PROPERTIES UNITY_BUILD ON)

set_target_properties(testing PROPERTIES UNITY_BUILD ON)
set_target_properties(filesystem PROPERTIES UNITY_BUILD ON)
set_target_properties(meta PROPERTIES UNITY_BUILD ON)
set_target_properties(memory PROPERTIES UNITY_BUILD ON)
set_target_properties(concurrency PROPERTIES UNITY_BUILD ON)
set_target_properties(serialization PROPERTIES UNITY_BUILD ON)
set_target_properties(crypto PROPERTIES UNITY_BUILD ON)
set_target_properties(math PROPERTIES UNITY_BUILD ON)
set_target_properties(audio PROPERTIES UNITY_BUILD ON)
set_target_properties(hid PROPERTIES UNITY_BUILD ON)
set_target_properties(nodegraph PROPERTIES UNITY_BUILD ON)
set_target_properties(nn PROPERTIES UNITY_BUILD ON)

set_target_properties(network PROPERTIES UNITY_BUILD ON)
set_target_properties(storage PROPERTIES UNITY_BUILD ON)
set_target_properties(tools PROPERTIES UNITY_BUILD ON)

set_target_properties(physics PROPERTIES UNITY_BUILD ON)
set_target_properties(ecs PROPERTIES UNITY_BUILD ON)
#set_target_properties(rendering PROPERTIES UNITY_BUILD ON)

set_target_properties(testing_test PROPERTIES UNITY_BUILD ON)
set_target_properties(filesystem_test PROPERTIES UNITY_BUILD ON)
set_target_properties(meta_test PROPERTIES UNITY_BUILD ON)
set_target_properties(memory_test PROPERTIES UNITY_BUILD ON)
set_target_properties(concurrency_test PROPERTIES UNITY_BUILD ON)
set_target_properties(serialization_test PROPERTIES UNITY_BUILD ON)
set_target_properties(crypto_test PROPERTIES UNITY_BUILD ON)
set_target_properties(math_test PROPERTIES UNITY_BUILD ON)
set_target_properties(audio_test PROPERTIES UNITY_BUILD ON)
set_target_properties(hid_test PROPERTIES UNITY_BUILD ON)
set_target_properties(nodegraph_test PROPERTIES UNITY_BUILD ON)

set_target_properties(network_test PROPERTIES UNITY_BUILD ON)
set_target_properties(storage_test PROPERTIES UNITY_BUILD ON)
set_target_properties(tools_test PROPERTIES UNITY_BUILD ON)

set_target_properties(physics_test PROPERTIES UNITY_BUILD ON)
#set_target_properties(ecs_test PROPERTIES UNITY_BUILD ON)
set_target_properties(rendering_test PROPERTIES UNITY_BUILD ON)

endif()

endif()
1 change: 0 additions & 1 deletion deps/ldeps
Submodule ldeps deleted from 92d1d0
16 changes: 8 additions & 8 deletions packages/audio/source/common/PortAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ namespace l::audio {
auto maxDevices = Pa_GetDeviceCount();
for (int32_t index = 0; index < maxDevices; index++) {
auto deviceInfo = Pa_GetDeviceInfo(index);
LOG(LogInfo) << "Audio device " << index << ": " << deviceInfo->name;
LLOG(LogInfo) << "Audio device " << index << ": " << deviceInfo->name;
}

mInputParameters.device = Pa_GetDefaultInputDevice(); /* default input device */
mOutputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */
if (mOutputParameters.device == paNoDevice) {
LOG(LogError) << "Error: No default output device.";
LLOG(LogError) << "Error: No default output device.";
return false;
}

Expand All @@ -104,10 +104,10 @@ namespace l::audio {

//auto inputInfo = Pa_GetDeviceInfo(mInputParameters.device);
mInputParameters.suggestedLatency = latencyMs / 1000.0f; // inputInfo->defaultHighInputLatency;
LOG(LogInfo) << "Port Audio set latency ms: " << static_cast<int32_t>(latencyMs);
LLOG(LogInfo) << "Port Audio set latency ms: " << static_cast<int32_t>(latencyMs);
}
else {
LOG(LogInfo) << "Port Audio recommended latency ms: " << static_cast<int32_t>(defaultLatency * 1000.0f);
LLOG(LogInfo) << "Port Audio recommended latency ms: " << static_cast<int32_t>(defaultLatency * 1000.0f);
mOutputParameters.suggestedLatency = defaultLatency;
}
mOutputParameters.hostApiSpecificStreamInfo = NULL;
Expand Down Expand Up @@ -149,7 +149,7 @@ namespace l::audio {
&mAudioStreamData);

if (err != paNoError) {
LOG(LogError) << "Failed to open stream: " << err;
LLOG(LogError) << "Failed to open stream: " << err;
return false;
}
return true;
Expand All @@ -159,7 +159,7 @@ namespace l::audio {
bool AudioStream::StartStream() {
auto err = Pa_StartStream(mPaStream);
if (err != paNoError) {
LOG(LogError) << "Failed to start stream: " << err;
LLOG(LogError) << "Failed to start stream: " << err;
return false;
}

Expand Down Expand Up @@ -212,7 +212,7 @@ namespace l::audio {
}
auto err = Pa_CloseStream(mPaStream);
if (err != paNoError) {
LOG(LogError) << "Failed to close stream: " << err;
LLOG(LogError) << "Failed to close stream: " << err;
return false;
}
return true;
Expand All @@ -237,7 +237,7 @@ namespace l::audio {
bool AudioManager::Init() {
auto err = Pa_Initialize();
if (err != paNoError) {
LOG(LogError) << "Failed to initialize port audio.";
LLOG(LogError) << "Failed to initialize port audio.";
return false;
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion packages/audio/tests/common/PortAudioTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ TEST(PortAudio, Setup) {


if (!stream->StopStream()) {
LOG(LogError) << "Failed to stop stream";
LLOG(LogError) << "Failed to stop stream";
}

manager.CloseOutStream("speaker");
Expand Down
2 changes: 1 addition & 1 deletion packages/concurrency/include/concurrency/ExecutorService.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace l::concurrency {
Worker(Worker&&) = default;
Worker(const Worker&) = default;
virtual ~Worker() override {
//LOG(LogDebug) << "Destroying " << mName;
//LLOG(LogDebug) << "Destroying " << mName;
}

RunnableResult run(const RunState& state) override;
Expand Down
48 changes: 24 additions & 24 deletions packages/concurrency/source/common/ExecutorService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace l::concurrency {
}

RunnableResult Runnable::run(const RunState&) {
LOG(LogInfo) << "Default run implementation";
LLOG(LogInfo) << "Default run implementation";
return RunnableResult::SUCCESS;
}

Expand Down Expand Up @@ -85,7 +85,7 @@ namespace l::concurrency {
if (mRunState.mDestructing) {
return;
}
if (gDebugLogging) LOG(LogDebug) << "Executor service shutdown is imminent";
if (gDebugLogging) LLOG(LogDebug) << "Executor service shutdown is imminent";
{
std::lock_guard<std::mutex> lock(mRunnablesMutex);
mRunState.mDestructing = true;
Expand All @@ -96,12 +96,12 @@ namespace l::concurrency {
}

do {
if (gDebugLogging) LOG(LogDebug) << "Executor service notifying threads of imminent shutdown";
if (gDebugLogging) LLOG(LogDebug) << "Executor service notifying threads of imminent shutdown";
std::this_thread::sleep_for(std::chrono::milliseconds(50));
mCondition.notify_all();
} while (!mRunState.IsShutdown());

if (gDebugLogging) LOG(LogDebug) << "Executor service notified all waiting schedulers to exit immediately";
if (gDebugLogging) LLOG(LogDebug) << "Executor service notified all waiting schedulers to exit immediately";

for (auto& t : mPoolThreads) {
if (t.joinable()) {
Expand All @@ -117,18 +117,18 @@ namespace l::concurrency {
}

void ExecutorService::startJobs() {
LOG(LogDebug) << "Start jobs " << mName;
LLOG(LogDebug) << "Start jobs " << mName;
mRunState.mRunning = true;
mCondition.notify_all();
}

void ExecutorService::pauseJobs() {
LOG(LogDebug) << "Pause jobs " << mName;
LLOG(LogDebug) << "Pause jobs " << mName;
mRunState.mRunning = false;
}

void ExecutorService::clearJobs() {
LOG(LogDebug) << "Clear jobs " << mName;
LLOG(LogDebug) << "Clear jobs " << mName;

std::lock_guard<std::mutex> lock(mRunnablesMutex);
mRunState.mRunning = false;
Expand All @@ -138,13 +138,13 @@ namespace l::concurrency {
bool ExecutorService::queueJob(std::unique_ptr<Runnable> runnable) {
{
if (mRunState.mDestructing) {
LOG(LogWarning) << "Service is shutdown and waiting for destruction";
LLOG(LogWarning) << "Service is shutdown and waiting for destruction";
return false;
}

std::lock_guard<std::mutex> lock(mRunnablesMutex);
if (mMaxQueuedJobs > 0 && mRunnables.size() > mMaxQueuedJobs) {
LOG(LogWarning) << "Too many jobs!";
LLOG(LogWarning) << "Too many jobs!";
return false;
}
mRunnables.push_back(std::move(runnable));
Expand Down Expand Up @@ -173,16 +173,16 @@ namespace l::concurrency {
}

std::unique_ptr<Runnable> runnable = nullptr;
if (gDebugLogging) LOG(LogDebug) << "Scheduler " << id << " started";
if (gDebugLogging) LLOG(LogDebug) << "Scheduler " << id << " started";
if (!mRunState.mRunning) {
std::unique_lock<std::mutex> lock(mRunnablesMutex);
if (gDebugLogging) LOG(LogDebug) << "Scheduler " << id << " is paused";
if (gDebugLogging) LLOG(LogDebug) << "Scheduler " << id << " is paused";
mCondition.wait(lock);
}
else {
std::unique_lock<std::mutex> lock(mRunnablesMutex);
if (mRunnables.empty()) {
if (gDebugLogging) LOG(LogDebug) << "Scheduler " << id << " is waiting for work";
if (gDebugLogging) LLOG(LogDebug) << "Scheduler " << id << " is waiting for work";
mCondition.wait(lock);
}
else {
Expand All @@ -194,10 +194,10 @@ namespace l::concurrency {

if (gDebugLogging) {
if (runnable->NumTries() > 0) {
LOG(LogDebug) << "Scheduler " << id << " picked up requeued(" << runnable->NumTries() << ") job";
LLOG(LogDebug) << "Scheduler " << id << " picked up requeued(" << runnable->NumTries() << ") job";
}
else {
LOG(LogDebug) << "Scheduler " << id << " picked up new job";
LLOG(LogDebug) << "Scheduler " << id << " picked up new job";
}
}
break;
Expand All @@ -206,58 +206,58 @@ namespace l::concurrency {
lock.unlock();

if (!runnable) {
if (gDebugLogging) LOG(LogDebug) << "Scheduler " << id << " sleeping";
if (gDebugLogging) LLOG(LogDebug) << "Scheduler " << id << " sleeping";
std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
}
}

if (runnable) {
if (gDebugLogging) LOG(LogDebug) << "Scheduler " << id << " executes task";
if (gDebugLogging) LLOG(LogDebug) << "Scheduler " << id << " executes task";
mRunState.mNumRunningJobs++;
RunnableResult result = runnable->run(mRunState);
mRunState.mNumRunningJobs--;
switch (result) {
case l::concurrency::RunnableResult::FAILURE:
if (gDebugLogging) LOG(LogDebug) << "Scheduler " << id << " task failed";
if (gDebugLogging) LLOG(LogDebug) << "Scheduler " << id << " task failed";
runnable.reset();
break;
case l::concurrency::RunnableResult::CANCELLED:
if (gDebugLogging) LOG(LogDebug) << "Scheduler " << id << " task was cancelled";
if (gDebugLogging) LLOG(LogDebug) << "Scheduler " << id << " task was cancelled";
runnable.reset();
break;
case l::concurrency::RunnableResult::SUCCESS:
if (gDebugLogging) LOG(LogDebug) << "Scheduler " << id << " task succeeded";
if (gDebugLogging) LLOG(LogDebug) << "Scheduler " << id << " task succeeded";
mNumCompletedJobs++;
runnable.reset();
break;
case l::concurrency::RunnableResult::REQUEUE_DELAYED:
runnable->Reschedule();
if (gDebugLogging) LOG(LogDebug) << "Job '" + runnable->Name() + "' could not run yet and was requeued ";
if (gDebugLogging) LLOG(LogDebug) << "Job '" + runnable->Name() + "' could not run yet and was requeued ";
queueJob(std::move(runnable));
break;
case l::concurrency::RunnableResult::REQUEUE_BACKOFF:
runnable->Backoff();
if (!runnable->Failed()) {

if (gDebugLogging) LOG(LogDebug) << "Job '" + runnable->Name() + "' was delayed and then requeued with backoff";
if (gDebugLogging) LLOG(LogDebug) << "Job '" + runnable->Name() + "' was delayed and then requeued with backoff";
queueJob(std::move(runnable));
}
else {
if (gDebugLogging) LOG(LogDebug) << "Job '" + runnable->Name() + "' failed and was cancelled";
if (gDebugLogging) LLOG(LogDebug) << "Job '" + runnable->Name() + "' failed and was cancelled";
runnable.reset();
}
break;
case l::concurrency::RunnableResult::REQUEUE_IMMEDIATE:
if (gDebugLogging) LOG(LogInfo) << "Scheduler " << mName << " task was requeued";
if (gDebugLogging) LLOG(LogInfo) << "Scheduler " << mName << " task was requeued";
queueJob(std::move(runnable));
break;
}
}
}
mRunState.mNumRunningJobThreads--;

if (gDebugLogging) LOG(LogInfo) << "Scheduler " << mName << " exited";
if (gDebugLogging) LLOG(LogInfo) << "Scheduler " << mName << " exited";
}

}
6 changes: 3 additions & 3 deletions packages/concurrency/tests/common/ContainersTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ TEST(Containers, Polymorphic) {
TEST_TRUE(meta::Type<Base>::hash_code() != meta::Type<DoubleDerived>::hash_code(), "");
TEST_TRUE(meta::Type<Derived>::hash_code() != meta::Type<DoubleDerived>::hash_code(), "");

LOG(LogInfo) << meta::Type<Base>::hash_code();
LOG(LogInfo) << meta::Type<Derived>::hash_code();
LOG(LogInfo) << meta::Type<DoubleDerived>::hash_code();
LLOG(LogInfo) << meta::Type<Base>::hash_code();
LLOG(LogInfo) << meta::Type<Derived>::hash_code();
LLOG(LogInfo) << meta::Type<DoubleDerived>::hash_code();
}

{
Expand Down
Loading
Loading