Add to Favorites    Make Home Page 5855 Online  
 Language Categories  
 Our Services  

Java » Tips and Tutorials » Development » Exploiting ThreadLocal to enhance scalability


Search Projects & Source Codes:

Title Exploiting ThreadLocal to enhance scalability
Platform n/a
Author Visit Author Website
Website Visit Website of - Exploiting ThreadLocal to enhance scalability
Category Java » Tips and Tutorials » Development
Hits 625
Description The ThreadLocal class appeared with little fanfare in version 1.2 of the Java platform. While support for thread-local variables has long been a part of many threading facilities, such as the Posix pthreads facility, the initial design of the Java Threads API lacked this useful feature. Further, the initial implementation was quite inefficient. For these reasons, ThreadLocal gets relatively little attention, but it can be very handy for simplifying the development of thread-safe concurrent programs. This article examines ThreadLocal and offers tips for exploiting its power.


Google Groups Subscribe to SourceCodesWorld - Techies Talk

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

Scripts Related to - Exploiting ThreadLocal to enhance scalability

Script Name

Working with preferences: the Preferences API Specification

The addition of the java.util.prefs package to Java 1.4 (through JSR 10) lets you manipulate user preference data and configuration data by providing you with access to an implementation-specific registry (for example, the Windows Registry on Windows platforms). This article introduces you to the Preferences class and walks you through its use. It puts it all together with a sample program.

Threading lightly : Reducing contention

While it's common to hear that synchronized method calls can be 50 times as expensive as unsynchronized method calls, these numbers can actually be quite misleading. With each successive JVM version, overall performance has improved, and the cost of uncontended synchronization has been reduced, making the issue of uncontended synchronization overhead less significant. Contended synchronization, however, is quite expensive. Moreover, a high degree of contention is disastrous for scalability -- an application that had a high degree of contended synchronization will exhibit markedly worse performance as the load increases. This article explores several techniques for reducing contention, and hence improving scalability, in your programs.

Diagnosing Java Code : The Orphaned Thread bug pattern

In multithreaded code, it is often common to use a single, master thread that drives the actions the other threads take. This master thread may send messages, often by placing them on a queue, that are then processed by the other threads. But if the master thread throws an exception, the remaining threads may continue to run, awaiting more input to the queue, causing the program to freeze. This article discusses detecting, fixing, and avoiding this bug pattern.

Diagnosing Java Code: The Impostor Type bug pattern

When special tags in fields are used to distinguish between types of objects, errors are possible in which a tag mislabels the associated data -- a bug pattern known as the Impostor Type. This article examines the symptoms and causes of this bug, defines ways to prevent this error from occurring, and discusses a tempting hybrid implementation that does not use impostor types but, in the end, turns out to have many of the same weaknesses. Article includes code snipets.

Improve the performance of your Java code

Many algorithms are expressed most concisely as tail-recursive methods. Compilers can automatically transform such methods into loops and thereby improve program performance, but this transformation is not required by the Java language specification, so not all JVMs will perform it. This means that tail-recursive methods in the Java language can result in unexpectedly large memory usage. This article demonstrates that dynamic compilation maintains the language's semantics while static compilation often doesn't. Learn why this matters and get a bit of code to help you determine whether your just-in-time (JIT) compiler can transform tail recursion on code while preserving semantics.

How to lock down your Java code

You inevitably spend some part of your week crunching code that you didn't write, and for which you may not have the source. This beginner's guide to opening up and locking down Java code walks you through the essentials of disassembling, decompiling, and obfuscating Java code, using examples from popular tools such as Mocha, HoseMocha, jmangle, and JODE.

Google Search


Source Codes is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions
Copyright ©2003-2019, All Rights Reserved.
Page URL:

Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review