Default CPU Scheduling Policy

By default, the Java Wireless Client software permits background applications to have some CPU time. A background application can also interrupt the foreground application under some circumstances.

Specifically, the CPU scheduling policy is fair share, which gives a higher proportion of the CPU to the foreground application. Background applications can still run, but their threads are scheduled less frequently.

This policy is implemented in the setForegroundMIDlet() method of the MIDletProxyList class. The MIDlet being put into the background is given minimal priority by calling the minPriority() method. The MIDlet being brought into the foreground is given normal priority by calling the normalPriority() method.

Alternative Policies and Their Implementations

One alternative to giving limited CPU access to background applications is to give the CPU exclusively to the foreground application. This might provide better interactive performance on systems with slow CPUs. It can also be good for some applications, such as a game that displays graphics continually and requires constant user input. This type of application probably needs to be frozen when in background. The user loses the game if the game is placed into the background and still allowed to use the CPU.

On the other hand, a device that freezes background MIDlets cannot run service or daemon applications that do not interact with the user at all. An example of such an application is a MIDlet that listens on the network for information about critical system software updates.

Another alternative to the default fair-use policy is an open-for-competition policy, that gives all applications equal priority, whether they are in the foreground or background.

To implement an open-for-competition policy for the CPU, modify the contents of the minPriority() and normalPriority() methods of the MIDletProxyUtils class so that they do nothing, instead of changing the tasks’ priorities or suspending or resuming them.

As you consider CPU policies, keep in mind that they interact with other policies for background MIDlets. For example, the policy interacts with your decisions on whether a background application is informed of its state change through a call to the pauseApp method, or whether it has access to shared resources such as sound. A uniform, correct answer does not exist.

Chapter 4 Other Multitasking Issues 31

Page 43
Image 43
Sun Microsystems 2 manual Default CPU Scheduling Policy

2 specifications

Sun Microsystems, founded in 1982, was a significant player in the computing industry, best known for its innovative technology solutions and workstations, particularly the Sun-4, which represented a key milestone in the company's history. The Sun-4 architecture, launched in 1987, utilized the SPARC (Scalable Processor Architecture) RISC processor, notable for its high performance and scalability.

One of the primary features of Sun Microsystems' platforms was their ability to efficiently handle multitasking and resource management, making them ideal for enterprise-level applications and development environments. Sun-4 workstations boasted impressive graphics capabilities with the addition of advanced graphical user interfaces, support for color displays, and the SUNVIEW windowing system, which enhanced user experience and productivity.

The Sun-4 systems also supported the SunOS operating system, which was based on UNIX. This operating system was engineered for stability and robustness, offering features like multiuser support, networked environments, and advanced security options. Moreover, SunOS provided seamless integration with various programming languages, including C and C++, facilitating software development that aligned with industry standards.

Another standout characteristic of Sun Microsystems was its commitment to open systems and standards. By providing developers with comprehensive tools and environments, such as the Standardized Application Programming Interface (API) and support for networking protocols, Sun facilitated interoperability among different computing platforms. The emphasis on open architecture also meant that customers could easily upgrade their systems without being locked into proprietary solutions.

Sun Microsystems was also ahead of its time with innovations in network computing. Their workstations were among the first to support network file systems and distributed computing concepts, enabling seamless data sharing across multiple systems. With the introduction of the Network File System (NFS), Sun revolutionized how data was accessed and managed across networks, which played a significant role in the evolving landscape of client-server computing.

In summary, the Sun Microsystems 2 and its successive innovations in workstation technology highlighted the company's forward-thinking approach. By integrating powerful performance with open systems, robust operating systems, and advanced networking capabilities, Sun laid the groundwork for modern computing, influencing various sectors from academia to enterprise solutions. Even after its acquisition by Oracle in 2010, the legacy of Sun Microsystems continues to be felt across the computing industry.