Add test examples for destroy() and kill_animal() functions - #111
Closed
oligamiq wants to merge 11 commits into
Closed
Add test examples for destroy() and kill_animal() functions#111oligamiq wants to merge 11 commits into
oligamiq wants to merge 11 commits into
Conversation
- Updated locking mechanism in better synchronization. - Enhanced error handling for worker termination and notifications. - Exporting example polyfill - Adapted the example for Firefox
- Introduced a new SharedArrayBuffer for destroy status in WorkerBackground and WorkerBackgroundRef. - Implemented destroy method to terminate all workers and close the worker context. - Added listen_destroy method to monitor the destroy status and trigger cleanup. - Updated worker communication to notify on errors and exits, ensuring proper resource management. - Enhanced worker initialization to include destroy status handling.
…al management - Removed the destroy_status property from WorkerBackground and WorkerBackgroundRef. - Updated WorkerBackground to manage animal workers using a Map for better tracking. - Implemented kill_animal functionality to allow termination of specific animal workers. - Adjusted worker message handling to accommodate changes in animal management. - Cleaned up related methods and ensured proper resource management during worker termination.
This example demonstrates the usage of WASIFarmAnimal.kill_animal() function for terminating individual threads managed by the thread spawner. The example includes: - Main orchestrator (index.ts) that creates WASIFarm and coordinates test - HTML test page (index.html) with Run Test button - Worker thread (test_runner.ts) that creates WASIFarmAnimal and calls kill_animal() - Thread spawning and background worker setup files Test verifies that kill_animal() can terminate specific threads without errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
Closing this PR - created by mistake. Development branch is maintained at oligamiq/browser_wasi_shim. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sorry, the AI has gone haywire.