Skip to content

Multithreaded Worker ​

For games, every 16ms per frame is extremely precious. If there are tasks that can be processed asynchronously, they can be run in a Worker, and the results returned to the main thread once the work is done.

OpenPaaS creates workers via sud.createWorker. A worker runs in a separate global context and thread; it cannot directly call methods on the main thread, and it has no rendering capability. For data transfer between the Worker and the main thread, both sides use Worker.postMessag to send data and Worker.onMessage to receive data. The transferred data is not shared directly but copied.

See Client API for details.