Skip to content

Commit 3f705d1

Browse files
authored
Merge pull request bjorn3#81 from oligamiq/main
implement thread-spawn
2 parents 9ca07f8 + 622e4c0 commit 3f705d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+14508
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
22
dist/
33
typings/
4+
.vscode/

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
path = test/wasi-testsuite
66
url = https://github.com/WebAssembly/wasi-testsuite
77
branch = prod/testsuite-base
8+
[submodule "threads/examples/wasi_multi_threads_rustc/rust_wasm"]
9+
path = threads/examples/wasi_multi_threads_rustc/rust_wasm
10+
url = https://github.com/oligamiq/rust_wasm
11+
sharrow = true

threads/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.vscode
2+
/dist
3+
/node_modules
4+
/types

threads/.swcrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://json.schemastore.org/swcrc",
3+
"jsc": {
4+
"parser": {
5+
"syntax": "typescript",
6+
"tsx": false,
7+
"dynamicImport": false,
8+
"decorators": false,
9+
"dts": true
10+
},
11+
"transform": {},
12+
"target": "esnext",
13+
"loose": false,
14+
"externalHelpers": false,
15+
"keepClassNames": true
16+
},
17+
"minify": true
18+
}

threads/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# A pure javascript shim for WASI Preview 1 threads
2+
3+
> [!WARNING]
4+
> The code in this directory is less production ready than the main browser_wasi_shim code.
5+
6+
This project is implement threads on browser_wasi_shim
7+
8+
# Features
9+
- [x] thread creation
10+
- [x] Filesystem wrapper accessible by multiple workers
11+
- [ ] thread pool
12+
13+
# Building
14+
```sh
15+
$ npm install
16+
$ npm run build
17+
```
18+
19+
# Running the demo
20+
```sh
21+
$ git submodule update --init
22+
$ cd examples && npm install && npm run dev
23+
```
24+
And visit http://localhost

threads/biome.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.1/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
7+
},
8+
"files": {
9+
"ignoreUnknown": false,
10+
"ignore": []
11+
},
12+
"formatter": {
13+
"enabled": true,
14+
"indentStyle": "space"
15+
},
16+
"organizeImports": {
17+
"enabled": true
18+
},
19+
"linter": {
20+
"enabled": true,
21+
"rules": {
22+
"recommended": true
23+
}
24+
},
25+
"javascript": {
26+
"formatter": {
27+
"quoteStyle": "double"
28+
}
29+
}
30+
}

threads/bun.lockb

133 KB
Binary file not shown.

threads/examples/bun.lockb

2.59 KB
Binary file not shown.

threads/examples/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"dependencies": {
3+
"@oligami/shared-object": "^0.1.1",
4+
"@xterm/xterm": "^5.5",
5+
"xterm-addon-fit": "^0.8.0",
6+
"@bjorn3/browser_wasi_shim": "^0.3.0"
7+
}
8+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
6+
<p id="note">
7+
####
8+
</p>
9+
10+
<script type="module" src="./index.ts"></script>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)