Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML5/JS - Start several webworkers
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COFor #2: You'd have to use `postMessage` from the Worker to send back a message to this parent JS saying that worker is done processing (and probably pass the results)...so you'd have to add an `onmessage` listener for each Worker, in the loop. You'd store all these responses in probably an array. When the number of responses in the array is the same as the number of workers created, that should mean all are done...and you can deal with that array you created. This could be made "cleaner" by using the concept of jQuery's deferred objects
      singulars
    2. CO"Cannot be cloned" here means that what you're *passing to* the worker couldn't be cloned. To avoid race conditions, objects are never shared between workers and the main thread. Objects must either be copied into the worker's memory space, or (with `Blob`s and typed arrays) the main thread may relinquish memory space to a worker and lose the reference to the object.
      singulars
    3. COOk. Read about it, but forgot it. Anyway. If I create a temporary variable in the loop, safe the array as a string and pass that string on, would that be a better solution? Somewhere I read, that I only send Strings to workers, somewhere else it says, that I can transfer variables? Thank you both for your explanation though, helps me to get started!
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload