Is Threading or the Web Workers API is supported on Fly machines?

I’m encountering an issue when trying to use libvips compiled to WebAssembly within a Cloudflare Workers environment. Specifically, the vips_init() function is throwing an “unreachable” error.

  • The same WebAssembly module works correctly when used in a browser environment with index.html or React.

So, if the Multi Threading is supported then I can run my WASM (initiliaze the vips_init()), and do all the image realted operation.

You can read the entire topic on github with this title : Unreachable error when calling vips_init() in Cloudflare Workers environment (WASM)

Here is more data about vips using threads.

On startup, you need to call VIPS_INIT() single-threaded. After that, you can freely create images in any thread and read them in any other thread. See the example at the end of this chapter. Note that results can also be shared between threads for you by the vips operation cache.

The exception is the drawing operators, such as vips_draw_circle(). These operations modify their image argument so you can’t call them on the same image from more than one thread. Reading from an image while another thread is writing to it with one of the draw operations will obviously also fail.

When libvips calculates an image, by default it will use as many threads as you have CPU cores. Use [vips_concurrency_set()]

This is from the offical libvips page.

So, The question is, Can the flymachine do this or manage multi threading specially for libvips ?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.