background preloader

Vijay.raghavan08

Facebook Twitter

Vijay Veeraraghavan

Java. Threading lightly, Part 2: Reducing contention. When we say a program is "too slow," we are generally referring to one of two performance attributes -- latency or scalability. Latency describes how long it takes for a given task to complete, whereas scalability describes how a program's performance varies under increasing load or given increased computing resources. A high degree of contention is bad for both latency and scalability. Why contention is such a problem Contended synchronizations are slow because they involve multiple thread switches and system calls. When multiple threads contend for the same monitor, the JVM has to maintain a queue of threads waiting for that monitor (and this queue must be synchronized across processors), which means more time spent in the JVM or OS code and less time spent in your program code.

Moreover, contention impairs scalability because it forces the scheduler to serialize operations, even if a free processor is available. Back to top Technique 1: Get in, get out Listing 1. Listing 2. Listing 3. Proposed Asynchronous Servlet API. With Java NIO, you can theoretically manage 10,000 read, write and read/write connections with a total of one thread. Yes, but it's not clear to me how you can manage this under the Servlet API. With a custom non-servlet server, then sure, assuming the request processing for each channel is lightweight enough. Note that the Servlet API extensions that Jetty has implemented could be standardised so that standard Servlets could work nicely with an NIO server efficiently like Jetty already has done.

See the title of this thread :) But if I have an NIO front end on the server and it calls a generic servlet, the servlet is going to consume a thread and can conceptually "do anything it wants", like block on another server resource (say, a JMS synchronous getMessage() call, or a particularly long SQL query).Basically, the problem I see is I can't see the advantages that a NIO based servlet container can provide, save serving up static resources.

Dependency Injection in Java EE 6 - Part 1. This series of articles introduces Contexts and Dependency Injection for Java EE (CDI), a key part of the soon to be finalized Java EE 6 platform. Standardized via JSR 299, CDI is the de-facto API for comprehensive next-generation type-safe dependency injection for Java EE. Led by Gavin King, JSR 299 aims to synthesize the best-of-breed dependency injection features from solutions like Seam, Guice and Spring while adding many useful innovations of its own. In this first article of the series, we are going to take a high-level look at CDI, see how it fits with Java EE overall and discuss basic dependency management as well as scoping. In the course of this series, we will cover features like component naming, stereotypes, producers, disposers, decorators, interceptors, events, the CDI API for portable extensions and many more.

A Quick Glance Back The primary focus of Java EE 5 was ease-of-use via POJO programming, annotations and convention-over-configuration. How the Pieces Fit Together. Java Performance Tuning, Profiling, and Memory Management | Java. Java application performance is an abstract word until you face its real implications. It may vary depending on your interpretation of the word 'performance'. This article is meant to give the developer a perspective of the various aspects of the JVM internals, the controls and switches that can be altered to optimal effects that suit your application. There is no single size that can fits all. You need to customize to suit your application. You may be facing one of the issues listed below: The dreaded java.lang.OutOfMemory ErrorYour application is literally crawling.

Before we take the plunge into solving the issues, we first need to understand some of the theory behind the issues. Theory What does the JVM do? Executes CodeManages Memory This includes allocating memory from the OS, managing Java allocation including heap compaction, and removal of garbaged objects Besides the above, the JVM also does stuff like managing monitors. Very Basic Java Theory 1. Infant mortality in Java JVM flavors. JVM tuning. Better Java Web Frameworks. I have been doing web application framework development for a long time. In my first experience, we developed a “Web Application Framework“, to ease development so that even a business user could write an application. As the years passed, I never saw any business user writing applications because of the fact that this job belongs to programmers. Today some 4GL or DSL tools are still on the search of the same promise. Before writing our own framework, we had used WebObjects development tools, for Java web development.

It was a very good platform that allowed front-end GUI development from a GUI editor with a component model. Every web element can be used as a component and it had events like “clicked”, and click handler Java code can be added with double-click in GUI editor. Web Application Frameworks meet the web application requirements.

The power of Java and richness of web technologies have produced many web frameworks (and that's not even considering internal frameworks). Java bookmarks. Books/Literature. Samuel Beckett. Samuel Barclay Beckett (/ˈbɛkɪt/; 13 April 1906 – 22 December 1989) was an Irish avant-garde novelist, playwright, theatre director, and poet, who lived in Paris for most of his adult life and wrote in both English and French. His work offers a bleak, tragicomic outlook on human nature, often coupled with black comedy and gallows humour. Beckett is widely regarded as among the most influential writers of the 20th century.[2] He is considered one of the last modernists.

As an inspiration to many later writers, he is also sometimes considered one of the first postmodernists. He is one of the key writers in what Martin Esslin called the "Theatre of the Absurd". His work became increasingly minimalist in his later career. Beckett was awarded the 1969 Nobel Prize in Literature "for his writing, which—in new forms for the novel and drama—in the destitution of modern man acquires its elevation".[3] He was elected Saoi of Aosdána in 1984.

Life and career[edit] Early life and education[edit] Sérgio Sant'Anna. 100 Best Novels. ULYSSES by James Joyce Written as an homage to Homer’s epic poem The Odyssey, Ulysses follows its hero, Leopold Bloom, through the streets of Dublin. Overflowing with puns, references to classical literature, and stream-of-consciousness writing, this is a complex, multilayered novel about one day in the life of an ordinary man.

Initially banned in the United States but overturned by a legal challenge by Random House’s Bennett Cerf, Ulysses was called “a memorable catastrophe” (Virginia Woolf), “a book to which we are all indebted” (T. S. Click here to read more about ULYSSES THE GREAT GATSBY by F. Set in the Jazz Age, The Great Gatsby tells the story of the mysterious millionaire Jay Gatsby, his decadent parties, and his love for the alluring Daisy Buchanan.

A PORTRAIT OF THE ARTIST AS A YOUNG MAN by James Joyce Published in 1916, James Joyce’s semiautobiographical tale of his alter ego, Stephen Dedalus, is a coming-of-age story like no other. LOLITA by Vladimir Nabokov U.S.A. In E. Magic realism. Magic realism or magical realism is a genre where magic elements are a natural part in an otherwise mundane, realistic environment.[1] Although it is most commonly used as a literary genre, magic realism also applies to film and the visual arts. One example of magic realism occurs when a character in the story continues to be alive beyond the normal length of life and this is subtly depicted by the character being present throughout many generations.

On the surface the story has no clear magical attributes and everything is conveyed in a real setting, but such a character breaks the rules of our real world. The author may give precise details of the real world such as the date of birth of a reference character and the army recruitment age, but such facts help to define an age for the fantastic character of the story that would turn out to be an abnormal occurrence like someone living for two hundred years. Etymology[edit] Literature[edit] Characteristics[edit] Fantastical elements[edit] One Hundred Years of Solitude. One Hundred Years of Solitude (Spanish: Cien años de soledad) is a 1967 novel by Colombian author Gabriel García Márquez that tells the multi-generational story of the Buendía family, whose patriarch, José Arcadio Buendía, founds the town of Macondo, the metaphoric Colombia.

Biography and publication[edit] Gabriel García Márquez was one of the four Latin American novelists first included in the literary Latin American Boom of the 1960s and 1970s; the other three writers were the Peruvian Mario Vargas Llosa, the Argentine Julio Cortázar, and the Mexican Carlos Fuentes. One Hundred Years of Solitude (1967) earned García Márquez international fame as a novelist of the Magical Realism movement within the literatures of Latin America.[4] Plot[edit] One Hundred Years of Solitude (1967) is the story of seven generations of the Buendía Family in the town of Macondo.

Symbolism and metaphors[edit] The fate of Macondo is both doomed and predetermined from its very existence. Characters[edit] Amaranta. Waiting for Godot. Plot[edit] Act I[edit] Estragon soon dozes off, but, after rousing him, Vladimir is not interested in hearing about Estragon's dreams—another recurring motif. Estragon wants to hear an old joke, which Vladimir starts but cannot finish, as he is urgently compelled to rush off and urinate due to a kidney ailment that pains him whenever he laughs.

Estragon next suggests that they hang themselves, but they abandon the idea when their strategy seems infeasible. Estragon asks what Godot is going to do for them once he arrives, but "Oh ... nothing very definite" is the best that Vladimir can manage.[7] When Estragon declares that he is hungry, Vladimir provides a carrot (among a collection of turnips), at which Estragon idly gnaws, loudly reiterating their boredom. Vladimir and Estragon begin to reflect on the encounter, with Vladimir suspecting that they have met Pozzo and Lucky before. Act II[edit] Characters[edit] Vladimir and Estragon[edit] Pozzo and Lucky[edit] The Boy[edit]

Cosmology. Intelligent Design of the Universe? or non-designed Multiverse? The Universe: Beyond the Big Bang. The Great Dark Cosmic Side Coincidence. [Earthlit Moon: Dorst/Druckmüller] One of the biggest mysteries — and wonders — in the known Universe flies over our heads every day. Or night, to be more precise. Alas, few human beings ever come to realize these questions even exist, much less ponder about them. Although often quoted polls suggest some people are still in the Middle Ages, most do know that planets are more or less spherical and revolve around the Sun. Now, then why does we always see the same Moon? One of the first images of the far side of the Moon, captured on 1959 The simple answer is that the Moon’s rotation period coincides with its orbital one, which in turn means that the time it takes for the Moon to turn around itself is the same as it takes for it to fly around Earth. Science does have an answer for it, and it involves the most traditional of the forces.

All this heat doesn’t come from nothing, and it effectively decelerates the rotation period, exactly the one that determines the frequency of the tides. Amoon. Why Our Universe Must Have Been Born Inside a Black Hole. “Accordingly, our own Universe may be the interior of a black hole existing in another universe.” So concludes Nikodem Poplawski at Indiana University in a remarkable paper about the nature of space and the origin of time.

The idea that new universes can be created inside black holes and that our own may have originated in this way has been the raw fodder of science fiction for many years. But a proper scientific derivation of the notion has never emerged. Today Poplawski provides such a derivation. Poplawski points out that the standard derivation of general relativity takes no account of the intrinsic momentum of spin half particles. This predicts that particles with half integer spin should interact, generating a tiny repulsive force called torsion. That’s interesting for a number of reasons. Astrophysicists have long known that our universe is so big that it could not have reached its current size given the rate of expansion we see now.

This is a Big Bang type event. Is the Universe Infinite?