Revocation

The revocation mechanism lets the system take a resource from one MIDlet to give the resource to another MIDlet. This second MIDlet is sometimes said to have preempted the resource from the first MIDlet. Resources are revoked without receiving any request from the MIDlet. The MIDlet might or might not be informed explicitly that the revocation is taking place, depending upon the type of resource being revoked.

After allocation by a MIDlet, many resources are deallocated explicitly by the MIDlet. For example, opening a socket allocates it, and closing the socket deallocates it, after which it can be reused by another MIDlet. If a socket is revoked, the underlying native resources are reclaimed, but the Java Socket object still exists. In this case, any subsequent operations on this Socket object results in an I/O error. The Java Wireless Client software doesn’t revoke sockets.

Revocation is not always so drastic. Sometimes it can occur almost transparently to the application. The device’s screen is a resource. When a MIDlet is put into the background, its access to the screen is revoked so that another MIDlet can paint to the screen. In this case, the only effect on the MIDlet might be that its hideNotify() method is called and that it no longer receives calls to the paint() method.

Another resource that can be revoked transparently is the CPU. When the CPU is revoked from a MIDlet, its threads simply stop running. When the MIDlet regains the CPU, its threads pick up where they left off.

Default Resource Allocation Policies

The Java Wireless Client software provides two preconfigured resource allocation policies: open and fixed. The open policy allows open competition among applications for resources. The fixed policy provides a fixed amount of resources for each application. Under the fixed policy, the reservation and limit for each resource are set to the same value. Setting the reservation and limit to the same value effectively creates a fixed partitioning of resources.

The policies have tradeoffs. Neither is clearly better than the other. Using the open resource policy might lead to unpredictable behavior. An application could at any time receive an error that a resource is not available. Users might find this behavior confusing. Under the fixed policy, if the amount of available resources is less than the reservation amount for a new MIDlet, the system refuses to start any more MIDlets. This occurs even if the actual amount of unused resources is sufficient for the new MIDlet, meaning valuable resources might go unused. However, this

24 Multitasking Guide • May 2007

Page 36
Image 36
Sun Microsystems 2 manual Default Resource Allocation Policies, Revocation

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.