Spinning wait cursor

From Wikipedia, the free encyclopedia

The spinning wait cursor is a cursor in Apple's Mac OS X used to indicate that an application is unresponsive. It is similar to the not responding status in the Microsoft Windows task manager.

The cursor has a large variety of colloquial and often creative names, such as spinning beachball of death, spinning pinwheel of death, and spinning pizza of death (see Nomenclature section).

Contents

[edit] History

The first wait cursor was a wrist-watch in early versions of Mac OS. Other busy indicators were a spinning black and white disc, or a spinning red and yellow disc. These cursors would be activated by an application when it was performing a lengthy operation. (Microsoft Windows would later use an hourglass cursor for the same concept.) Until Mac OS 8, implementation of animated cursors was left to the application. Although Mac OS 8 introduced the Appearance Manager, which provided a standard way of handling busy cursors, even beyond Mac OS 8 different applications used different indicators[1].

In Mac OS X, Apple gave the wheel psychedelic colors and a more dynamic appearance. More significantly, Apple changed its meaning. Rather than being an indication that an application was performing an action it expected to take a while, it meant that the system software had noticed that an application had stopped responding to events. This could indicate that the application was in an infinite loop, or just performing a lengthy operation and ignoring events.

Like many other Mac OS 9 to Mac OS X changes, this new wait cursor originated with NEXTSTEP which eventually became the basis for Mac OS X.

[edit] Detailed explanation

Each application has an event queue which receives events from the operating system (for example key presses and mouse button clicks). If an application takes too long to process the events in its event queue (regardless of the exact cause) the operating system displays the wait cursor whenever the cursor hovers over that application's windows. This threshold is 5 seconds in Mac OS X v10.4, but was previously 2 seconds.

This is meant to indicate that the application is temporarily unresponsive, a state from which the application may recover, however it may also indicate that the application has entered an unrecoverable state. Users can use terminate an unresponsive application, by using "Force Quit" under the Apple menu, the keystroke command-option-escape, or the Force Quit command found by right-clicking the icon of an unresponsive application icon in the Dock.

While one application is unresponsive, typically other applications are usable in the meantime. For example, if Safari freezes up and the beach ball appears, users can switch to iTunes and use that until Safari begins to respond again.

[edit] Nomenclature

The official Apple Human Interface Guidelines refers to this cursor as the "spinning wait cursor". Some Mac users often refer to the colorful wait cursor by a variety of more creative names, for example "the spinning beach ball (pinwheel, pizza, etc) of death" (a reference to Microsoft Windows Blue Screen of Death). The act of an application getting the spinning wait cursor is often referred to as "beachballing" or "SPODing".

[edit] Guidelines, tools and methods for developers

Apple's guidelines suggest that developers try to avoid the spinning wait cursor, and suggest other user interface indicators, such as an asynchronous progress indicator.

Spin Control, a developer tool used to monitor hangs, a situation that calls the spinning wait cursor.
Enlarge
Spin Control, a developer tool used to monitor hangs, a situation that calls the spinning wait cursor.

Possible causes include:

  • Applications often do not poll for events during operations requiring intense processing. Sometimes developers do not poll simply because the operation should take less time than the operating system's threshold for displaying the spinning wait cursor, but the operation takes longer than the developer anticipated. An application that has stopped polling events during an operation will usually recover once the operation is complete.
  • Bugs in applications can cause them to stop responding to events; for instance, an infinite loop. Applications that do this rarely recover.
  • Problems with the virtual memory system such as slow paging caused by hard disk errors will cause the wait cursor to appear. In this case, multiple applications will display the wait cursor as they attempt to access memory that must be paged in until the hard disk and virtual memory system recover.
  • The wait cursor can also indicate bugs in Mac OS X.

Spin Control is an application that comes with the Mac OS X Developer Tools. It allows the user to monitor and sample applications that are either not responding or performing a lengthy operation. Each time an application does not respond and the spinning wait cursor is activated, Spin Control will sample the application to determine which code is causing the application to stop responding. With this information the developer can determine what code is the cause of the application not responding, and rewrite code to avoid the cursor being activated.

Developers have limited control over the behavior of the wait cursor:

  • In Carbon, the Carbon Events Manager manages the wait cursor. Excessive polling of input devices can cause the spinning wait cursor to appear, or even cause the application to hang.
  • In Cocoa, the spinning wait cursor's behavior is managed by the standard NSCursor methods.

[edit] External links