Skip to content

Commit

Permalink
Update README.md with architecture details and add allocator diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
oligamiq committed Dec 25, 2024
1 parent e57e5ed commit b785fcb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions threads/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,18 @@ $ git submodule update --init
$ cd examples && npm install && npm run dev
```
And visit http://localhost

# Architecture
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.

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.

Please refer to the diagram below for more details.

<!-- @/architecture/slide1.svg -->
![slide1](./architecture/slide1.svg)

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.

<!-- @/architecture/slide2.svg -->
![slide2](./architecture/slide2.svg)
Binary file added threads/architecture/architecture.pptx
Binary file not shown.
Loading

0 comments on commit b785fcb

Please sign in to comment.