Oracle Blog

Blog for jtc

Wednesday Jun 10, 2009

Just in time for the start of JavaOne 2009, Sun released the latest version of its real-time Java platform, Java RTS 2.2, in early access form. New features of this release include but are not limited to:

Monday Oct 15, 2007

The brief but brilliant era of computing has seen companies come and go, many relegated to the ash heap of history because they failed to heed this simple rule:

In the long run general purpose solutions will always win out over specialized proprietary ones.

As a long time employee of Sun Microsystems, I've witnessed firsthand the effects, both positive and negative, that this law has had on my company. Sun can attribute it's initial meteoric rise to the fact that it offered a viable alternative to the popular minicomputer platform of the day. The first Sun workstations were built from commercial off-the-shelf components, and although nearly equal in performance to the minicomputer, they were so much more affordable that they became good enough. And of course over time, as Moore's law might dictate, those initial deficiencies quickly dissipated, and in fact surpassed traditional minicomputer capabilities.

Somewhere along the line Sun lost sight of this ideal and began incorporating more proprietary technology into their products. At first the strategy appeared to be successful as Sun was well positioned to reap huge benefits during the Internet bubble. Meanwhile, low-cost general purpose servers were continuously improving. When the bubble burst they in turn became good enough alternatives to the powerful but costly Sun servers. The resulting decline of Sun was rapid, and it's taken the better part of a decade for us to recover. This story has been told -- and will continue to be again and again -- for those refusing to learn this lesson. A professor of mine once told me, "If there's anything we've learned from history, it's that we haven't learned anything from history".

When markets mature, even those where technology is paramount, economic considerations dominate. General purpose systems scale on every dimension (unit, management, training and integration costs) whereas proprietary systems do not. A switch to more standard components should in no way be construed as stifling innovation. Rather, general purpose systems help create new innovation by building from common elements economically appealing in their own right, and presumably even more economically beneficial once combined.1

[1] The above paragraph was taken in bits and pieces from an email exchange with Dave Hofert, Java Embedded and Real-Time Marketing Manager. His points were so compelling I couldn't help myself.

Real-time industrial controllers could be the next market ripe for disruption. Admittedly this is an entrenched and conservative lot. But the economics of general purpose computing cannot be denied. As organizations strive to further eliminate cost out of their system, revisiting usage and deployment of industrial controllers, typically via custom proprietary PLCs, is falling under review.
Consequently, at the behest of one of the world's largest industrial corporations, Sun has partnered with iGoLogic, a systems integrator, and Axiomtek, an industrial PC board manufacturer, to create the real-time controller platform pictured below.

Among others, here are some of the compelling benefits of this platform:

It's based on standard x86 hardware. The motherboards aren't much larger than a postcard, are energy efficient, and yet have PC class processing power. The number of competing manufacturers in this space eliminates vendor lock-in and insures price sensitivity and further rapid innovation.

Real-time applications are developed using Sun's Java Real-Time System, enabling you to leverage the largest development community on the planet. Obscure development languages and highly specialized environments are longer needed.

Industrial Networking Protocols (e.g PROFIBUS, EtherCAT) are easily migrated to this platform, partly because of the wealth of development tools available.

The system utilizes an IDE flash drive from Apacer. In addition to eliminating the moving parts associated with a traditional disk drive, it consumes less power and makes the system more resistant to shock and vibration. Overcoming the longevity limitations of flash memory, Apacer has done some interesting work on wear leveling algorithms effectively extending the lifetime of the flash device well past the expected lifetime of the industrial controller.

Let this be our first salvo fired over the proprietary industrial encampment. We believe the opportunity is immense, but also understand that to achieve any measure of success, partnering with organizations who are truly experts in this arena is critical. If you think you can add further value, we'd love to talk.

Friday Feb 23, 2007

In the financial services market, there is a general trend to move key systems close to, or even right inside the exchanges themselves -- the idea being that the nearer you are to the source, the less network infrastructure and latency you'll experience. With this advantage firms can potentially take on additional transaction loads at higher transaction rates. These systems typically use the latest Intel or AMD processors and run a commercial distribution of Linux.1

Indeed these co-located systems perform as expected almost all the time. But there are periodic intervals where the latency increases by several orders of magnitude, the ramifications of which could be financially disastrous. After eliminating other components, the street seems to be focusing its wrath on commercial Linux distributions and their lack of real-time capabilities.

The linux community is actively working to include underpinnings to support real-time, but as of yet these capabilities are not part of a standard major (i.e. Red Hat, SuSE) distribution. Instead, an alternate version of linux with real-time extensions is offered. These extensions are in effect separate non-standard OS releases, and have not had the soak time required by many institutions.

Back in the early 90's, I volunteered to move over to Sun's newly formed SunSoft business unit. One of it's main charters was to push the concept of running Solaris on alternate, i.e. Intel, platforms. (Don't get me started here, can you imagine where Solaris would be right now if Sun had actually taken this initiative seriously back then?) As part of that transition, I had the opportunity to take a Solaris Internals course, and couldn't help but notice the effort put in architecturally to address short latencies. I still have the course notebook; it is dated September 1993.

The point is Solaris already has the real-time capabilities claimed by these add-on linux extensions. It is built into the operating system, has been for quite some time, is rock solid and doesn't require any additional components. A partial list of features include:

Real-time Scheduling Class - In order to allow equal opportunity to system resources, traditional Unix schedulers transparently change process priorities to give competing processes a fair chance. Although well suited for timesharing systems, this is unacceptable real-time behavior. Since its outset, Solaris through its SVR4 roots, introduced the concept of alternate scheduling classes. It includes a real-time scheduling class, which furnishes fixed-priority process scheduling at the highest priority levels in the system.

Fine-Grained Processor Control / Processor Sets - Solaris allows threads and applications to be bound to specific individual processors. In addition, processors within a system can be grouped together as a processor set and dedicated to real-time tasks.2 Here's a nice article describing processor sets. Dated June 2001, processor sets have been a part of Solaris since release 2.6.

Interrupt Sheltering - Available since Solaris 7, this feature enables CPUs to be sheltered from unbound interrupts. It can be used in conjunction with processor sets to shelter all CPUs in a processor set. Note: At least one processor in the system must be kept unsheltered.

Priority Inheritance - Priority inversion occurs when a high-priority thread blocks on a resource that is held by a lower-priority thread. A runnable thread with a priority between the high and low-priority threads creates a priority inversion because it can receive processor resources ahead of the high-priority thread.

To avoid priority inversions with kernel synchronization primitives, Solaris employs a transient priority inheritance protocol. The protocol enables the low-priority thread holding the resource to “inherit” the higher priority of the blocked high-priority thread. This approach gives the blocking low-priority thread the CPU resources it needs to complete its task as soon as possible so that it can release the synchronization primitive. Upon completion, all threads are returned to their respective priorities by the kernel.3

High Resolution Timers -
Solaris 8 introduces the cyclic subsystem; this allows for timers
of much better granularity -- in the microsecond and nanosecond range -- without burdening the system with a high
interrupt rate.

Memory Locking - The paging in and out of data from disk to memory may be considered normal behavior for virtual memory systems, but it is unacceptable for real-time applications. Solaris addresses this problem by allowing the
locking down of a process' pages into memory, using mlock(3C) or mlockall(3C) system calls.

Early Binding - By default, linking of dynamic libraries in the Solaris
is done on an as-needed basis. The runtime binding for a dynamically linked
function isn't determined until its first invocation. Though flexible,
this behavior can induce indeterminism and unpredictable jitter in the
timing of a real-time application. To avoid jitter, the Solaris provides for early binding of dynamic libraries. By setting
the LD_BIND_NOW environment variable to "1", libraries are bound at application
startup time. Using early binding together with memory locking is a very
effective approach to avoiding jitter.4

So why not give Solaris more consideration? It's way more mature. And in the unlikely event (chcukle, chuckle) that a lower-latency OS might not solve all your performance problems, I'd put my money on Solaris and DTrace over anything Linux could offer in finding the real problem.