java multithreaded communication (mutual wake-up, circular printing) wait,notify cases and possible program blocking problems of false wake-up

1. Circular printing public class OutWord { private String word = "output A"; public synchronized void outA() throws InterruptedException { if (word.equals("B output")){ this.wait(); } //Output word System.out.println("word = " + word); word="B output"; this.notify(); } ...

Posted by rockofaith on Sat, 26 Feb 2022 06:20:49 +0100

Six methods of Java statistical code execution time

In daily development, we often need to test the execution time of some code, but we don't want to use JMH( Java Microbbenchmark harness (Java micro benchmark suite) is such a heavy testing framework, so this paper summarizes some commonly used execution time statistics methods in Java, including the following 6 kinds in total, as shown in the f ...

Posted by dhodge on Sat, 26 Feb 2022 06:19:05 +0100

[fundamentals of Java language: 4 & 5 & 6 (constants & variables and data types & operators)]

4. constant Constant: refers to the fixed data in the Java program. classification typemeaningData examplesinteger constant integerPositive and negative integersDecimal constantdecimalPositive and negative decimalscharacter constants Enclosed in single quotation marks, there is only one character and cannot be empty'word', 'a', '1'string con ...

Posted by dsartain on Sat, 26 Feb 2022 06:13:04 +0100

Introduction to Python zero Basics - 17 - assignment operators and comparison operators in Python

Python assignment operator What are the assignment operators? operatordescribeExamples=assignmentc = a+b-=Subtraction assignmentc -= a -> c = c - a=+Additive assignmentc += a -> c = c + a*=Multiplicative assignmentc *= a -> c = c * a/=division assignment c /= a ->c=c / a%=Modular assignmentc %= a -> c= c % a**=Power assignm ...

Posted by the apprentice webmaster on Sat, 26 Feb 2022 00:06:15 +0100

log4cpp source code reading: threading tool class

threading namespace Location: in the include/log4cpp/threading directoryThe corresponding classes are under the threading namespace. This namespace contains some thread synchronization classes and methods to get the current thread. There is also an implementation of thread scoped local variablesBecause thread is a system kernel object, and dif ...

Posted by spambadger on Fri, 25 Feb 2022 17:44:14 +0100

Java ~ inheritance and polymorphism

catalogue inherit Concept of inheritance Inherited syntax Access to parent class members super keyword The difference between super and this Execution order and inheritance mode of inheritance relationship Polymorphism Implementation conditions of polymorphism rewrite The difference between rewriting and overloading Upward and downw ...

Posted by rivasivan on Fri, 25 Feb 2022 17:06:17 +0100

Java priority queue

Java priority queue Introduction to PriorityQueue PriorityQueue is the priority queue. Priority queue can ensure that the elements taken out each time are the smallest or largest elements in the queue (Java priority queue defaults to the smallest element taken out each time). Size relationship: the comparison of elements can be naturally ...

Posted by eraxian on Fri, 25 Feb 2022 16:41:42 +0100

Introduction to Minio, stand-alone and cluster deployment, JAVA upload and download practice

Official website address https://min.io/ Official website document https://docs.min.io/docs/minio-quickstart-guide.html Download address https://dl.min.io/ Basic concepts Object: the basic object stored in Minio, such as file and byte streamBucket: the logical space used to store objects. The data of each bucket is isolated from each oth ...

Posted by stueee on Fri, 25 Feb 2022 16:31:59 +0100

Feign remote call lost request header

In business, you need to use modules A and B, which use spring Session to share Session data. The business in module B can only be operated after the user logs in. When A calls B's service, it cannot obtain the user's Session information in module B, resulting in module B determining that the requesting user has not logged in, resulting in modu ...

Posted by receiver on Fri, 25 Feb 2022 15:22:46 +0100

Oracle database statement summary

Introduction and description Four traditional mainstream databases:     Oracle MySQL SqlServer DB2 Non relational database: Redis MongoDB The mainstream database is relational database: there is an association relationship between tables When we say install database, we mean install database service When creating a database, it refers t ...

Posted by rockobop on Fri, 25 Feb 2022 14:05:34 +0100