Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Curious question #1

Open
innerop opened this issue Feb 12, 2019 · 0 comments
Open

Curious question #1

innerop opened this issue Feb 12, 2019 · 0 comments

Comments

@innerop
Copy link

innerop commented Feb 12, 2019

Hi,

This is terrific.

I'm just wondering why you've opted to use generators instead of worker threads and shared memory with the Atomics API (https://hacks.mozilla.org/2016/05/a-taste-of-javascripts-new-parallel-primitives/)

You can do everything with worker threads and shared memory that you're doing with generators but use all CPU cores.

Are you aware of any disadvantages?

EDIT:

The scenario the encloses the question above is having a realtime dashboard based on IMGUI (immediate mode graphics) pattern and using 2D Canvas or WebGL context for drawing. In this scenario, we can have workers sharing a virtual canvas (shared 2D array representing pixels) and each worker is in charge of updating a virtual widget on that canvas. On the main UI thread, we read from that 2D array and draw on canvas.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant