Skip to content

Load vector datasets asynchronously (#36) - #85

Merged
pmeems merged 2 commits into
developmentfrom
async-vector-dataset-load
Nov 15, 2026
Merged

pmeems merged 2 commits into
developmentfrom
async-vector-dataset-load

Conversation

@pmeems

@pmeems pmeems commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Adds asynchronous vector loading to the ActiveX control so dataset opening and scene preparation do not block the host's apartment thread.

IMapWinGISControl5 adds begin, cancel, and end methods. Work uses the existing GDAL dispatcher and completion event; the control commits the prepared candidate on its owner thread before notifying clients. Synchronous loading and existing COM interfaces remain unchanged. No new dependencies are required.

CMake Debug x64 build and all 430 CTest cases passed (three opt-in cases skipped). MSBuild Debug x64 built with zero warnings; Core and ActiveX tests passed, with one and three opt-in skips respectively.

- Add versioned asynchronous vector-load API and shared completion delivery.

- Prepare data off-thread, commit on the owner thread, and preserve synchronous loading.

- Cover completion, cancellation, failures, and shutdown; update docs and plan.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical lifecycle defects let End consume results before owner-thread finalization and allow replayed completion to overwrite a successful load, while regression tests leave notification ordering and destruction timing unverified.

4 open issues
What changed in this PR

Adds asynchronous vector loading to the ActiveX control, moving dataset opening and scene preparation off the host’s apartment thread while preserving synchronous loading and existing COM interfaces.

Changes:

  • Adds begin, cancel, and end methods through IMapWinGISControl5.
  • Reuses the GDAL dispatcher and completion event, committing prepared layers on the owner thread.
  • Adds asynchronous-load tests and updates API, architecture, and lifecycle documentation.

Builds and tests were not run during this review.

File Description
tests/​MapWinGIS.ActiveX.Tests/​ActiveXActivationTests.cpp Adds load, cancellation, failure, lifetime, and interface tests.
src/​MapWinGIS.ActiveX/​MapWinGISControl.h Declares asynchronous loading methods and operation state.
src/​MapWinGIS.ActiveX/​MapWinGISControl.cpp Implements preparation, cancellation, result retrieval, and owner-thread commit.
src/​MapWinGIS.ActiveX/​MapWinGIS.ActiveX.idl Adds the versioned IMapWinGISControl5 interface.
src/​MapWinGIS.ActiveX/​GdalOperationDispatcher.h Declares custom worker callbacks and completion-result access.
src/​MapWinGIS.ActiveX/​GdalOperationDispatcher.cpp Supports custom work and completed-result updates.
src/​MapWinGIS.ActiveX/​GdalEventSource.h Declares owner-thread completion callbacks.
src/​MapWinGIS.ActiveX/​GdalEventSource.cpp Runs completion callbacks before notifying clients.
README.md Introduces asynchronous vector loading.
docs/​TESTING.md Describes the added test coverage.
docs/​PORTING.md Documents the new interface and loading behavior.
docs/​gdal-integration.md Explains shared completion events and result retrieval.
docs/​ARCHITECTURE.md Documents worker preparation, owner-thread commit, and lifecycle behavior.
.github/​plans/​development-review-fix-plan-20261113.md Records Phase 9 completion and reported validation.
.ai/​memory/​architecture/​activex.md Updates the documented automation interface structure.

Review effort: Balanced

- Wait for owner-thread finalization before consuming results
- Ignore replayed completions after a layer is committed
- Verify notification ordering and control destruction with deterministic tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pmeems
pmeems enabled auto-merge (squash) November 15, 2026 20:36
@pmeems
pmeems merged commit 8a10ebb into development Nov 15, 2026
6 checks passed
@pmeems
pmeems deleted the async-vector-dataset-load branch November 15, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants