synchronized usage in Java basic thread synchronization

I. overview of synchronized Synchronized is a key word in Java. Synchronized can ensure that only one method can enter the critical area at the same time when a method or code block is running. At the same time, it can also ensure the memory visibility of shared variables. Every object in Java can b ...

Posted on Sun, 27 Oct 2019 20:14:47 -0700 by MortimerJazz

java multithreading and concurrency -- java concurrency cooperative control 1

Thread collaboration Thread/Executor/Fork-Join - thread start, run, end – lack of collaboration between threads synchronized synchronization – restrict only one thread to critical area – simple and rough, with a little performance lossHow to achieve the cooperation between threads? ...

Posted on Sun, 27 Oct 2019 05:24:41 -0700 by JohnResig

IV. initialization and destruction of Srping's Bean

Initialization and destruction of the Bean of Srping In general, there are three ways to initialize and destroy bean s, namely: Custom initialization, destroy method Implement the initialization bean (initialization logic) and disposablebean (destruction logic) interfaces provided by spring JSR250; @ PostConstruct, @ PreDestroy performs initia ...

Posted on Sun, 27 Oct 2019 04:13:46 -0700 by ryanhowdy

java related method calls

Article directory I. distribution 1.1 static dispatch (overload) 1.2 dynamic dispatch (rewrite) 1.3 single dispatch and multiple dispatch 2. Dynamic type language support 2.1 what is dynamic type language 2.2 how does Java support dynamic types? I. distribution 1.1 static dispatch (overloa ...

Posted on Sun, 27 Oct 2019 03:41:59 -0700 by crunchyfroggie

Understanding and application of observer model

scene A science and technology company is currently developing a project. The design team needs to report the progress of the project to the Department Manager. There are mainly two modules to update the progress of the original business module and add the completion progress of the new business mod ...

Posted on Sun, 27 Oct 2019 03:12:12 -0700 by public-image

How to press test the multi line single update interface

The data value of each row is allowed to be update d once, million level test data. Last time I talked about how to press test the single line multiple update s, mainly to solve the difficulty of how the request parameters in a single thread are different from last time. In this paper, we talk about multiple lines and single update for pressu ...

Posted on Sun, 27 Oct 2019 02:27:11 -0700 by shmick25

Demonstration of common methods of Arrays tool class

java.util.Arrays is a tool class used to operate arrays, including comparison, sorting, search and other methods. Here is a simple example: Arrays.tostring (array name) returns the string representation of the contents of the specified array Arrays.deeptostring (array name) returns the string representation of the "deep" content of ...

Posted on Sun, 27 Oct 2019 02:25:04 -0700 by jpmm76

java intermediate DBUtils

1: query runner provides an API for sql statement operations. update(Connection conn, String sql, Object... params) Execute an SQL INSERT, UPDATE, or DELETE query.Using update in Queryrunner class for data insertionYou can insert, delete and update the SQL statement. public class queryrunner { private ...

Posted on Sun, 27 Oct 2019 00:20:35 -0700 by accident

Java basic tutorial -- simulating browser to send request

JAVA visit web page Test the use of get and post methods to access the web page, you can receive the server's request, and write to the html file. import java.io.*; import java.net.*; import java.util.*; public class TestGetPostPage { // param: request the parameter in the form of name1 = value1 & Name2 = Value2. public static Strin ...

Posted on Sat, 26 Oct 2019 12:40:45 -0700 by condorchou

API gateway service: Notes on using Spring Cloud Zuul

zuul application end Add module: zuul app to spring cloud demo project Add dependency in pom.xml file: <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-zuul</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId& ...

Posted on Sat, 26 Oct 2019 12:31:57 -0700 by contex