Added a new section on architecture on threads #84
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.
This pull request includes several changes to improve error handling, update dependencies, and add documentation for the
threads
module. The most important changes include adding error handling in the worker threads, updating thepackage.json
dependencies, and documenting the architecture of the module.Error Handling Improvements:
threads/src/shared_array_buffer/thread_spawn.ts
: Added a try-catch block aroundwasi.start
and posted error messages to the main thread if an error occurs. [1] [2]threads/src/shared_array_buffer/worker_background/worker.ts
: Added error handling logic to terminate workers and notify about errors using an allocator.Dependency Updates:
threads/package.json
: Updated several development dependencies to their latest versions, including@biomejs/biome
,@swc/cli
,@swc/core
,better-typescript-lib
,typescript
,vite
, andvite-plugin-dts
.Documentation:
threads/README.md
: Added a new section on architecture, explaining the asynchronous and synchronous file access in different threads, the need for a dedicated thread for web workers, and included diagrams for better understanding.threads/RELEASE.md
: Documented the first release and a bug fix in version 0.1.1.Version Update:
threads/package.json
: Updated the version from 0.1.0 to 0.1.1 to reflect the changes and bug fixes.Code Refactoring:
threads/src/shared_array_buffer/worker_background/worker_blob.ts
: Updated the inline code for the worker blob to include error handling improvements.