Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User

UWP Bespiel : Webworkers

26.06.2018 (👁4928)

UWP Sample : Webworkers

 

 

Standards-based Web Workers are supported for multithreaded JavaScript apps. Web Workers can improve the responsiveness of your app by removing tasks from the UI thread. Web Workers can use the postMessage function to communicate with the UI thread.

This example uses two Web Workers to calculate prime numbers. Even though this task is CPU intensive, the UI remains responsive because the calculations run inside the Web Workers.

 

Calculate Primes

 

 

 

Code running in a Web Worker has access to the <b>setTimeout</b> and <b>setInterval</b> methods. These methods can be used to throttle long running scripts or for other general timing purposes. Click the buttons to instruct the Worker to set

a timeout or interval timer. At each callback of the timer, the Web Worker posts messages which are then displayed by the example.

 

 

Web Workers also support Channel Messaging. Channel Messaging can be used to enable direct communication between workers. In this example, the UI thread creates two workers and a set of ports through which the Web Workers can directly communicate. The

UI thread then passes the string "Hello World" to the first Web Worker, which passes it on to the second Web Worker via the specified port, which then passes it back to the UI thread.

 

 

 

 

Man findet das Beispiel unter

https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/WebWorkers