masterpiece are the Java programming language guide , detailing the equals() issues surrounding and hashCode() .
Tony Sintes in this article provided by Javaworld explains how the hash-based container works and how it is used equals() and hashCode() (July 2002).
On the slide, Robert Uzgalis of the Department of Computer Science at Oakland University in New Zealand introduces some of the criticisms of the Java
[Java concurrent programming practice] -- synchronized, asynchronous ynchronized
In our practical application, we may often encounter such a scenario: multiple threads read or write the same data, access the same file, and so on. If we do not control this situation, it is very easy to cause errors. In java, the concept of critical section is introduced to solve t
. Following these patterns (not exceeding their limits when using them) can help you implement most use cases safely and use volatile variables for better performance.Reference Learning
You can refer to the original English text on the DeveloperWorks global site in this article.
Java Concurrency in practice: How-to Manual for developing concurrent programs
are those that process asynchronous event scheduling. In this column's July article, we studied thread pools and work queues, and how many Java applications use the runnable queue mode to schedule small work units.
You can simply create a new thread for a task to derive the backend thread that executes the task. This method is very attractive:
New thread (New runnable () {...}). Start ();
Although this practice
Java Drp project practice-Servlet, drpservletOrigin
Before explaining the Servlet, we need to first introduce a word CGI, that is, the Common GatewayInterface is the meaning of a universal gateway interface, which provides an interface for a computer program with the HTTP protocol or WWW Service, that is, the meaning of the human-computer interaction interface. When a Web application runs on a server and a
The Java language may be the most widely used programming language that relies on garbage collection, but it is not the first. Garbage collection has become an integral part of many programming languages, including Lisp, Smalltalk, Eiffel, Haskell, ML, scheme, and Modula-3, and has been in use since the early the 1960s. In this article in Java theory and Practice
Java Theory and Practice: block memory leakage with weak referencesWeak references make it easy to express object lifecycle relationships.
Document options
Most of us will never consider writing these utilities ourselves when you need XML parsers, text indexing programs, and search engines, regular expression compilers, XSL processors, or PDF generators in your project. Whenever these facilities are needed, we use a commercial or open source implementation to perform these tasks for the simple reason that the existing implementations work well and are easy to
cases provides better performance and scalability than locks. If you strictly follow the use of volatile conditions-that is, the variable is really independent of the other variables and its own previous values-in some cases you can use the volatile substitution synchronized to simplify the code. However, volatile the code used is often more error-prone than code that uses locks. The pattern described in this article covers some of the most common use cases that can be used volatile instead syn
application of this pattern is exceeded, it will become very difficult to combine these two competing synchronization mechanisms.
Conclusion
Compared with the lock, the volatile variable is a very simple but fragile synchronization mechanism that will provide better performance and scalability than the lock in some cases. If you strictly follow the volatile usage conditions-that is, variables are truly independent from other variables and their previous values-in some cases, you can usevolatile
Java Theory and Practice: Concurrent collection Classes
util.concurrent In addition to many other useful concurrent building blocks, the Douglea package contains some of the major collection types
List and
Map high-performance, thread-safe implementations. In this month's
Java theory and Practice ,
In the current java World, many things are called x×let, and x×let all mean small programs. For example, applet applications, servlet server-side applets, mini programs in the midlet mobile phone, and small programs in the portlet portal container. In this section, we will introduce the applet. This is not a lot of thi
Never thought, "Java Array conversion to list" unexpectedly have so many knowledge, shock and entrainment a little unbearable. About "Java Array conversion to list" is actually very basic knowledge, and there are a lot of people in the blog has been discussed, it is inevitable that I feel that writing such a discussion article how much is not necessary! On second thought, "Do not accumulate silicon step, no
, removes the last element from the container in the method body and joins the consumer. Examples of use are: carcontainerIf you have another setThe method Pop (setOur idea is that the pop receives the parameter application is "E of some kind of superclass set", through the "and Super keyword combined use just can achieve this purpose, namely setThird edition public void pop (setAfter the modification, setWith the use of the extends or Super keyword on the method parameters, you get th
Telescopic
Content:
Synchronized Quick Review
The improvement of the synchronized
Compare the scalability of Reentrantlock and synchronized
Condition variable
It's not fair
Conclusion
Resources
About the author
The evaluation of the paper
Related content:
Java Theory and Practice series
Synchronization is not the enemy
Reducing contention
IBM developer Kits for the
Java5 adds a new class library concurrency set Java.util.concurrent, which provides rich APIs for concurrent programs that are easier and more flexible in Java 5. This article through a network server model, to practice JAVA5 multithreaded programming, the model used in the JAVA5 thread pool, blocking queues, can be reset locks, but also
for the performance analysis of Java programs. Then, starting from the cause of the problem, this article briefly introduces its thinking and method to solve the problem. First of all, the concept of flame diagram is briefly introduced in this paper. A flame diagram is both an open source tool and a type of picture. As a two-dimensional picture, the x-axis of the flame graph represents the total number of
outstanding open source Concurrency Toolkit, java.util.concurrent, which contains mutex, trust, and performance-performing collection classes such as queues and hash tables, and some work queue implementations under concurrent access. The Pooledexecutor class in this package is an efficient, widely used, and correct implementation of a thread pool based on a work queue. Instead of trying to write the code yourself, it's easy to make mistakes, and you can consider using some of the tools in the
Java Theory and Practice: Use Weak references to block memory leaks-Linux general technology-Linux programming and kernel information. The following is a detailed description. Although Java™In theory, a program written in a language does not have a "memory leak", but sometimes objects are not garbage collected after they are no longer part of the logic state of t
Java Theory and Practice:Concurrent collection classConcurrenthashmap and copyonwritearraylist provide thread security and improved scalability.
Document options
Valign = "TOP"> Width = "122">
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.