You may have noticed that the prime-number example in Fig. 23.6 produces prime numbers rapidly. The asynchronous

Question:

You may have noticed that the prime-number example in Fig. 23.6 produces prime numbers rapidly. The asynchronous task in the example is probably not compute bound, but rather I/O bound—that is, the speed of displaying the results on the screen slows the program down, not the ability of the processor to determine the prime numbers. Reimplement the example of Fig. 23.6 with a compute bound algorithm such as the recursive Fibonacci calculation of Fig. 23.1. Try calculating all the Fibonacci values from 0 to 47. When you run the app, observe that as the Fibonacci numbers get higher, the calculation speed slows dramatically, slowing the updates of the Progress- Bar and the TextBox that shows the calculation results. Because this calculation is compute bound, the overall speed of the app will depend on your computer’s processor—you may want to decrease or increase the largest Fibonacci number the app calculates accordingly. For example, on our computer the Fibonacci of 47 takes a couple of minutes to calculate.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Visual C# How to Program

ISBN: 978-0134601540

6th edition

Authors: Paul J. Deitel, Harvey Deitel

Question Posted: