Skip to content

How to use threads? #1

@alshdavid

Description

@alshdavid

Hey all, I am trying to run a Rust binary that uses threads and am getting an unsupported platform error

fn main() {
  std::thread::spawn(move || {
    println!("Hello, world from thread!");
  })
  .join()
  .unwrap();
}

Built with:

cargo build --release --target wasm32-wasi

Then in the console I use

$ wget http://localhost:8080/main.wasm
$ ./main.wasm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions