Programs that react to events instead of simply running commands are gaining popularity as a way to program on multicore processors, particularly with Java, says Typesafe senior software engineer Josh Suereth in a recent InfoWorld interview.
Reactive programming uses code that instructs the system to take an action after another action is complete, instead of simply coding a chain of instructions, says Suereth, noting that the term is interchangeable with asynchronous programming.
"The main reason this matters is because as we go multicore, if you program in this style, there are new techniques to optimize across CPUs," he says. "I would say [reactive programming is becoming important now] because of the explosion in cores on CPUs. You're no longer able to stick your logic on a single thread and have that be the most efficient path."
Java 7 has launched the fork/join library that enables users programming in a reactive style to retain effective performance characteristics in that style, in the same manner as writing sequential code.
Suereth notes that reactive programming is especially useful with Web development because its way of partitioning helps the framework optimize code. He also says the Java 8 Lambda feature is "a revolutionary change" that makes Java especially well-suited to reactive programming by fixing syntax and scoping issues.
From InfoWorld
View Full Article
Abstracts Copyright © 2013 Information Inc., Bethesda, Maryland, USA
No entries found