Skip to content

Commit aa7259e

Browse files
committed
Update README.md with architecture details and add allocator diagram
1 parent e57e5ed commit aa7259e

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
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)
137 KB
Binary file not shown.

0 commit comments

Comments
 (0)