Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit bd10386

Browse files
authored
Introduce primitive threading in unified scheduler (#34676)
* Introduce primitive threading in unified scheduler * Make the internal struct ExecutedTask not pub * Improve wording a bit * Explain scheduler main loop's overhead sensitivity * Improve wording a bit * Define ChainedChannel{Sender, Receiver} wrappers * Clean up a bit * Use derivative to avoid manual Clone impl * Clarify comment * Remove extra whitespace in comment * Remove unneeded dyn trait for ChainedChannel * Remove the accumulator thread for now * Fix typo * Use unimplemented!() to convey intention better
1 parent bfbe03a commit bd10386

File tree

7 files changed

+535
-60
lines changed

7 files changed

+535
-60
lines changed

Cargo.lock

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ ctrlc = "3.4.2"
185185
curve25519-dalek = "3.2.1"
186186
dashmap = "5.5.3"
187187
derivation-path = { version = "0.2.0", default-features = false }
188+
derivative = "2.2.0"
188189
dialoguer = "0.10.4"
189190
digest = "0.10.7"
190191
dir-diff = "0.3.3"

programs/sbf/Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-scheduler-logic/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ repository = { workspace = true }
88
homepage = { workspace = true }
99
license = { workspace = true }
1010
edition = { workspace = true }
11+
12+
[dependencies]
13+
solana-sdk = { workspace = true }

unified-scheduler-logic/src/lib.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
// This file will be populated with actual implementation later.
1+
use solana_sdk::transaction::SanitizedTransaction;
2+
3+
pub struct Task {
4+
transaction: SanitizedTransaction,
5+
index: usize,
6+
}
7+
8+
impl Task {
9+
pub fn create_task(transaction: SanitizedTransaction, index: usize) -> Self {
10+
Task { transaction, index }
11+
}
12+
13+
pub fn task_index(&self) -> usize {
14+
self.index
15+
}
16+
17+
pub fn transaction(&self) -> &SanitizedTransaction {
18+
&self.transaction
19+
}
20+
}

unified-scheduler-pool/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ license = { workspace = true }
1010
edition = { workspace = true }
1111

1212
[dependencies]
13+
assert_matches = { workspace = true }
14+
crossbeam-channel = { workspace = true }
15+
derivative = { workspace = true }
16+
log = { workspace = true }
1317
solana-ledger = { workspace = true }
1418
solana-program-runtime = { workspace = true }
1519
solana-runtime = { workspace = true }

0 commit comments

Comments
 (0)