Skip to content

Commit 6c8d7a0

Browse files
authored
Merge pull request bjorn3#84 from oligamiq/main
Added a new section on architecture on threads
2 parents 63303b8 + aa7259e commit 6c8d7a0

File tree

11 files changed

+1113
-894
lines changed

11 files changed

+1113
-894
lines changed

threads/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,18 @@ $ git submodule update --init
2626
$ cd examples && npm install && npm run dev
2727
```
2828
And visit http://localhost
29+
30+
# Architecture
31+
In the thread that maintains the file system for `@bjorn3/browser_wasi_shim`, file access is awaited asynchronously, while in the thread executing the WASM, file access is performed synchronously.
32+
33+
Since the functions called within the WASM are invoked synchronously, it is not possible to properly create web workers. Therefore, it is necessary to first create a dedicated thread for generating web workers.
34+
35+
Please refer to the diagram below for more details.
36+
37+
<!-- @/architecture/slide1.svg -->
38+
![slide1](./architecture/slide1.svg)
39+
40+
Additionally, since data of unknown size is being exchanged, an allocator is essential. A simple allocator is implemented on the assumption that the allocated memory will be released promptly.
41+
42+
<!-- @/architecture/slide2.svg -->
43+
![slide2](./architecture/slide2.svg)

threads/RELEASE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# v0.1.0
2+
first release
3+
4+
# v0.1.1
5+
- fix: Fixed a bug where the main thread could not recover after an error occurred following block_start_on_thread.
137 KB
Binary file not shown.

threads/architecture/slide1.SVG

Lines changed: 1 addition & 0 deletions
Loading

threads/architecture/slide2.SVG

Lines changed: 1 addition & 0 deletions
Loading

threads/bun.lockb

-702 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)