Skip to content
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
206e8ff
Consistent trailing underscores
eddyashton Sep 22, 2025
b9465d3
Allow static task names
eddyashton Sep 22, 2025
44d22eb
Missing get_name
eddyashton Sep 22, 2025
8fa820f
WIP: Flatten/hide JobBoard
eddyashton Sep 22, 2025
7fe4375
Move JobBoard to PImpl, and directly move tasks to waiting workers
eddyashton Sep 22, 2025
3c38b92
Replace .empty() with a more useful Summary
eddyashton Sep 22, 2025
6c1fbc8
Refactor:
eddyashton Sep 23, 2025
9573727
Oops
eddyashton Sep 25, 2025
8ec6020
Split out tests of static API
eddyashton Sep 25, 2025
519f4d2
Merge branch 'main' of github.com:microsoft/CCF into task_system_feed…
eddyashton Sep 25, 2025
07d0004
Oops
eddyashton Sep 25, 2025
3673813
Pull out ShiftSupervisor where it could be used by tests
eddyashton Sep 25, 2025
4ce733e
Rename
eddyashton Sep 25, 2025
9fd1d15
Use ThreadManager for tests rather than utils
eddyashton Sep 25, 2025
89809e1
Tidy
eddyashton Sep 25, 2025
3b53334
Restore demo's status logging
eddyashton Sep 26, 2025
4404192
Convinced myself this is probably safe
eddyashton Sep 26, 2025
542e9b1
Merge branch 'main' of github.com:microsoft/CCF into task_system_feed…
eddyashton Oct 9, 2025
b925c58
Merge branch 'main' into task_system_feed_consumers_directly2
achamayou Oct 14, 2025
78e19f6
Merge branch 'main' of https://github.com/microsoft/CCF into task_sys…
eddyashton Oct 15, 2025
0b403b0
Move ownership into Consumer
eddyashton Oct 16, 2025
11245c3
Docs and renames and ownership fiddling, and one critical bug
eddyashton Oct 16, 2025
b45fc57
Restore non-owning collection
eddyashton Oct 16, 2025
06ef414
Hide equivalent warnings
eddyashton Oct 16, 2025
b7b3f4e
Single cleanup path
eddyashton Oct 16, 2025
97a78d7
Merge branch 'main' of https://github.com/microsoft/CCF into task_sys…
eddyashton Oct 16, 2025
fc5b0bd
s/set_worker_count/set_task_threads
eddyashton Oct 16, 2025
c6a938f
notaword
eddyashton Oct 16, 2025
6a5ef77
Suggestions:
eddyashton Oct 16, 2025
eacb601
Merge branch 'main' of https://github.com/microsoft/CCF into task_sys…
eddyashton Oct 21, 2025
53c8d44
Change ownership to shared pointer, to handle either side dying
eddyashton Oct 21, 2025
c479df7
Merge branch 'main' into task_system_feed_consumers_directly2
achamayou Oct 29, 2025
81e11be
Merge branch 'main' into task_system_feed_consumers_directly2
eddyashton Oct 29, 2025
e902aba
Check progress at the _end_ of a range, not the start (when you're ra…
eddyashton Oct 29, 2025
ac247bc
Merge branch 'main' into task_system_feed_consumers_directly2
eddyashton Oct 29, 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
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Checks: >
-bugprone-assignment-in-if-condition,
-bugprone-casting-through-void,
cert-*,
-cert-con36-c,
-cert-con54-cpp,
-cert-err58-cpp,
-cert-dcl50-cpp,
concurrency-*,
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,11 @@ add_ccf_static_library(
# CCF task system library
add_ccf_static_library(
ccf_tasks
SRCS ${CCF_DIR}/src/tasks/task_system.cpp ${CCF_DIR}/src/tasks/job_board.cpp
SRCS ${CCF_DIR}/src/tasks/task_system.cpp
${CCF_DIR}/src/tasks/job_board.cpp
${CCF_DIR}/src/tasks/ordered_tasks.cpp
${CCF_DIR}/src/tasks/fan_in_tasks.cpp
${CCF_DIR}/src/tasks/thread_manager.cpp
)

# Common test args for Python scripts starting up CCF networks
Expand Down Expand Up @@ -572,6 +574,7 @@ if(BUILD_TESTS)
${CMAKE_CURRENT_SOURCE_DIR}/src/tasks/test/ordered_tasks.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tasks/test/delayed_tasks.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tasks/test/fan_in_tasks.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tasks/test/tasks_api.cpp
)
target_link_libraries(task_system_test PRIVATE ccf_tasks)

Expand Down
2 changes: 1 addition & 1 deletion doc/build_apps/example_cpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ A :cpp:type:`ccf::indexing::Strategy` may offload partial results to disk to avo
Since the indexing system and all the strategies it manages exist entirely within the enclave, this has the same trust guarantees as any other in-enclave code - users can trust that the results are accurate and complete, and the query may process private data.

An example :cpp:type:`ccf::indexing::Strategy` is included in the logging app, to accelerate historical range queries.
This :cpp:type:`strategy <ccf::indexing::strategies::SeqnosByKey_Bucketed_Untyped>` stores the list of seqnos where every key is written to, offloading completed ranges to disk to cap the total memory useage.
This :cpp:type:`strategy <ccf::indexing::strategies::SeqnosByKey_Bucketed_Untyped>` stores the list of seqnos where every key is written to, offloading completed ranges to disk to cap the total memory usage.
In the endpoint handler, rather than requesting every transaction in the requested range, the node relies on its index to fetch only the `interesting` transactions; those which write to the target key:

.. literalinclude:: ../../samples/apps/logging/logging.cpp
Expand Down
6 changes: 4 additions & 2 deletions src/tasks/basic_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ namespace ccf::tasks
Fn fn;
const std::string name;

BasicTask(const Fn& _fn, const std::string& s = "[Anon]") : fn(_fn), name(s)
BasicTask(const Fn& fn_, const std::string& s = "BasicTask") :
fn(fn_),
name(s)
{}

void do_task_implementation() override
{
fn();
}

std::string_view get_name() const override
const std::string& get_name() const override
{
return name;
}
Expand Down
18 changes: 8 additions & 10 deletions src/tasks/fan_in_tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ namespace ccf::tasks
{
struct FanInTasks::PImpl
{
std::string name;
IJobBoard& job_board;
JobBoard& job_board;

// Synchronise access to pending_tasks and next_expected_task_index
std::mutex pending_tasks_mutex;
Expand Down Expand Up @@ -71,16 +70,16 @@ namespace ccf::tasks

FanInTasks::FanInTasks(
[[maybe_unused]] FanInTasks::Private force_private_constructor,
IJobBoard& job_board_,
const std::string& name_) :
pimpl(std::make_unique<FanInTasks::PImpl>(name_, job_board_))
JobBoard& job_board_) :
pimpl(std::make_unique<FanInTasks::PImpl>(job_board_))
{}

FanInTasks::~FanInTasks() = default;

std::string_view FanInTasks::get_name() const
const std::string& FanInTasks::get_name() const
{
return pimpl->name;
static const std::string name = "FanInTasks";
return name;
}

void FanInTasks::add_task(size_t task_index, Task task)
Expand Down Expand Up @@ -124,9 +123,8 @@ namespace ccf::tasks
}
}

std::shared_ptr<FanInTasks> FanInTasks::create(
IJobBoard& job_board_, const std::string& name_)
std::shared_ptr<FanInTasks> FanInTasks::create(JobBoard& job_board_)
{
return std::make_shared<FanInTasks>(Private{}, job_board_, name_);
return std::make_shared<FanInTasks>(Private{}, job_board_);
}
}
9 changes: 4 additions & 5 deletions src/tasks/fan_in_tasks.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Apache 2.0 License.
#pragma once

#include "tasks/job_board_interface.h"
#include "tasks/job_board.h"
#include "tasks/task.h"

#include <memory>
Expand All @@ -27,13 +27,12 @@ namespace ccf::tasks
};

public:
FanInTasks(Private, IJobBoard& job_board_, const std::string& name_);
FanInTasks(Private, JobBoard& job_board_);
~FanInTasks();

static std::shared_ptr<FanInTasks> create(
IJobBoard& job_board_, const std::string& name_ = "[FanIn]");
static std::shared_ptr<FanInTasks> create(JobBoard& job_board_);

std::string_view get_name() const override;
const std::string& get_name() const override;

void add_task(size_t task_index, Task task);
};
Expand Down
Loading