Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

6. Scatterplot Maps > Deployment Issues (Acquire and Refine)

Deployment Issues (Acquire and Refine)

For an online project, downloading two megabytes of data is likely to be a problem. In its current iteration, the program will stop until all data has been downloaded. A better alternative is to use the built-in Thread class to load the data asynchronously. The thread acts independently of the rest of the program, gradually adding locations by incrementing placeCount. When placeCount and totalCount are identical, the data has finished loading.

A thread provides a way to bundle a function in your program so that it can run at the same time as another part of the program. In this case, rather than waiting for the data to download, a thread can be used for the download while the main draw( ) method of the program continues to run. Because the program is still running, it remains responsive to user input, which makes it feel faster than if the program halted until the download was finished.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint