Java Theory and Practice:Concurrent collection classConcurrenthashmap and copyonwritearraylist provide thread security and improved scalability.
Document options
Valign = "TOP"> Width = "122">
DatabaseService mysqld Restart//Restart MySQL databaseNetstat-NTLP //See if MySQL port is 3306I use the local test remote connection, the author is using the Mysqlworkbench client if not connected, remember to switch off the firewall under the test service iptables Restart/stop/start switch off the firewall can be connected, it is the port problem scheme1/sbin/iptables- I.INPUT- PTcp--Dport3306 -jACCEPT//Open port: 3306/etc/rc.D/init.D/iptables Save//Save/etc/init.D/iptables restartorService I
-agent to create perf-pid.map text files. This file lists the 16-binary symbolic address, size, and symbol name. Then, from 2009 onwards, the Perf_events tool in Linux added support for JIT symbols. The tool examines the/tmp/perf-pid.map file to complete the check of symbols from the language virtual machine. For the second aspect, the JVM adds a new option,-xx:+preserveframepointer. With the efforts of Zoltán, Oracle and other engineers, the latest JDK9 and JDK8 have added this option to save t
method that can be declared private or protected is declared as public. But unlike FindBugs, it uses bytecode analysis and many built-in bug pattern detectors to find common bugs in your code. It can help you find out where your code is intentionally or unintentionally deviating from good design principles. (For an introduction to FindBugs, see Chris Grindstaff's article, "FindBugs, part 1th: Improving code Quality" and "FindBugs, part 2nd: Writing custom detectors.") )
Design recommendations
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
to IdeaIf it is much easier to add the JAVAP command to the compiler to view the bytecode file, here's how to add the JAVAP command to idea:(1) Open the Setting menu,(2) Find the Extension tool in the tool click Open,(3) Click the Green Plus button in the upper left corner of the left area to pop up an edit box like this, enter as prompted,(4) Click OK after completion, click on the setting window of apply and OK, to here has completed the JAVAP command to add,(5) View the added commands and ru
consumption only once, the same partition will only bind one consumer information.5, if a consumer hangs, consumer and partition binding information will be reassigned, as far as possible to ensure load balance6, if the number of consumer is greater than the number of partitions, will cause the redundant part of the thread can not get the message, constantly Got ping response for sessionid:0x153413bc26e0082 after 2ms. is a waste of resourcesIf more than one server starts the consumer process, i
Java improvements-understanding the application of String and String. intern () In practice, stringintern
1. First, String does not belong to eight basic data types. String is an object.Because the default value of an object is null, the default value of String is also null, but it is a special object and has some features that other objects do not have.2. Both new String () and new String ("") declare a ne
be recognized by the Computer. In fact, floating-point numbers are not suitable for precise calculations and are suitable for scientific calculations. float and double are used to denote numbers with a decimal point, and these numbers are stored in the form of scientific notation. When a number such as 50.534, converted to scientific notation in the form of 5.053e1, its decimal point moved to a new position (that is, Floating) visible, floating point is used for scientific calculation, for accu
@override inside the retention set to source, compiled successfully do not have the information of these checks, on the contrary, @Deprecated inside the retention set as runtime, This means that in addition to being warned at compile time which deprecated method is used, it is possible to find out whether the method is deprecated when executed.3) @DocumentedInclude this note in the Javadoc4) @InheritedAllow subclasses to inherit annotations from parent class4.Use@Description (value= "instance u
Java's JVM Learning note Five (practice writing your own class loader)Course Source: http://download.csdn.net/detail/yfqnihao/4866501In the third and fourth sections we have been emphasizing that class loaders and security managers can be dynamically extended, or that they can be customized by the user, and today we are trying to do this part of the practice, of course, before reading this article, at least
Apriori condition (precondition): Some methods contain a priori condition based on a state. For example, you cannot remove an element from an empty queue, and the queue must be in a non-empty state before the element is deleted. The operation of a state-based priori condition becomes a dependent state operation.
In a single thread, if an operation fails to meet a priori condition, it can only fail, but in a concurrent program a priori condition may become true due to an operation performed b
1 Use the tool (Code->reformate code) in idea to reformat the code below, and then look at the Code menu to find a feature that feels best for you. Submit, plus your own study number watermark.public class Codestandard {public static void main (String [] args) {StringBuffer buffer = new StringBuffer (); Buffer.append ( ' S '); Buffer.append ("Tringbuffer"); System.out.println (Buffer.charat (1)); System.out.println (Buffer.capacity ()); System.out.println (Buffer.indexof ("Tring")); System.out.p
on hash
The entire allocation process is artificially mastered, and when certain requests must be assigned to the specified server, the modifications are simpler
Disadvantages:
Large number of coding needs rigorous testing
Need to proactively maintain a routing table, storage is an issue to consider
When the request volume is large, the routing table capacity will increase, you can consider to deposit in Redis
The above is my underst
"); System.out.println ("usage:democlient [Host=localhost] [port=9090]"); System.out.println ("This demo assumes you has a table called \" Example\ "with a column family called \" family1\ "); String host = "192.168.58.101"; int port = 9090; Use passed in arguments instead of defaults if (args.length >= 1) {host = Args[0]; } if (Args.length >= 2) {port = Integer.parseint (args[1]); } int timeout = 10000; Boolean framed = false; Ttransport transport = new Tsocket (host
input. Each line have the number of all possible ways to distribute D CDs among N nephews.Sample Input1 203 100 0Sample Output159049Ask N^d. Large number, Java, the large number of C + + template is really no love, decisive JAVA.Import java.io.*;import java.math.*;import java.util.*;p ublic class Main {public static void Main (string[] arges) { C1/>biginteger N; int D; Scanner cin = new Scanner (system.in); while (Cin.hasnext ())
The following information was drawn from the project:Https://www.cnblogs.com/whenever/p/5526420.htmlHttps://www.cnblogs.com/jpwz/p/5715852.htmlHttps://www.cnblogs.com/sddychj/p/6102192.htmlhttps://zzk.cnblogs.com/s/blogpost?Keywords=java+socket+ Multithreading __requestverificationtoken= Cfdj8gf3jjv4cttdney2uyrcgz0kcosvpzzwlayvpu5r95d1oz8nhsq1qxox6l_ S0tdix36-vqfer-yemgbxg29wz0fs1ft-swezszh4opfatuvkj4sdctgegzuvkv9kknpiiyjcjtrprjpj2jiy8x7rzzhmulspblixf
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.