Skip to content

Commit 337e9bd

Browse files
committed
Merge branch 'refactor/fse-per-call-scheduler-159' into 'main'
refactor(fse): move scheduler to per-call local variable Closes #159 See merge request arolang/aro!178
2 parents 0eafe60 + dece04f commit 337e9bd

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

Sources/ARORuntime/Core/FeatureSetExecutor.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import AROParser
2323
/// By default, statements execute sequentially. When `enableParallelIO`
2424
/// is true, I/O operations may run in parallel based on data dependencies
2525
/// while maintaining sequential semantics (ARO-0011).
26-
public final class FeatureSetExecutor: @unchecked Sendable {
26+
public final class FeatureSetExecutor: Sendable {
2727
// MARK: - Properties
2828

2929
private let actionRegistry: ActionRegistry
@@ -32,10 +32,7 @@ public final class FeatureSetExecutor: @unchecked Sendable {
3232
private let expressionEvaluator: ExpressionEvaluator
3333

3434
/// Whether to enable parallel I/O optimization (ARO-0011)
35-
public var enableParallelIO: Bool = false
36-
37-
/// The statement scheduler for parallel I/O (lazy initialization)
38-
private lazy var scheduler = StatementScheduler()
35+
public let enableParallelIO: Bool
3936

4037
// MARK: - Initialization
4138

@@ -128,6 +125,7 @@ public final class FeatureSetExecutor: @unchecked Sendable {
128125
do {
129126
if enableParallelIO {
130127
// ARO-0011: Data-flow driven parallel I/O execution
128+
let scheduler = StatementScheduler()
131129
_ = try await scheduler.execute(
132130
analyzedFeatureSet,
133131
context: context

Tests/AROuntimeTests/FeatureSetExecutorTests.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ struct FeatureSetExecutorTests {
3636

3737
@Test("Enable parallel IO property")
3838
func testEnableParallelIOProperty() {
39-
var executor = createExecutor()
40-
#expect(executor.enableParallelIO == false)
41-
42-
executor.enableParallelIO = true
39+
let executor = createExecutor(enableParallelIO: true)
4340
#expect(executor.enableParallelIO == true)
4441
}
4542

0 commit comments

Comments
 (0)