Java practice and analysis of thread pool
Catalog
Why do I need thread pools?
demand
Thread pool design
1. Number of threads
2,keepAliveTime
3. The task queuing policy is linkedblockingqueue
4. Reject policy
Source code analysis
Result analysis
attach
Why do I need thread pools?
In daily development, we are prone to the followin ...
Posted by dsnhouse on Thu, 06 Feb 2020 08:13:29 +0100
Java nionionio non blocking network communication
1. Blocking and non blocking
Traditional IO flows are blocking. That is, when a thread calls read() or write(), the thread is blocked until some data is read or written, and the thread cannot perform other tasks during this period. Therefore, when the network communication is completed for IO operat ...
Posted by reyes99 on Thu, 06 Feb 2020 06:05:39 +0100
Using and mastering the basic knowledge of urllib Library of python crawler
Four modules of urlib
urrlib.request
urrlib.error
urrlib.parse
urrlib.robotparser
Get page source code
import urllib.request
response=urllib.request.urlopen("http://www.baidu.com")
print(response.read().decode('utf-8'))
#Get Baidu's source code
post request
import urllib.parse
import urllib.reque ...
Posted by lily on Tue, 04 Feb 2020 14:14:01 +0100
Windows thread pool functions
Windows provides a thread pool mechanism matching the completion port.
1. Call function / work item asynchronously
2. Call a function every other time / / timing item
3. Call a function when the kernel object is triggered / / wait item
4. Call a function / / I/O item when the asynchronous I/O reques ...
Posted by pikemsu28 on Tue, 04 Feb 2020 12:36:38 +0100
Java uses Alibaba cloud OSS and SMS
Alibaba cloud OSS and SMS tools
Import dependency
<dependency>
<groupId>cn.gjing</groupId>
<artifactId>tools-aliyun</artifactId>
<version>1.0.0</version>
</dependency>
I. OSS
1, configuration
The following configurations are required except for the last four
aliyun:
# User key, obtai ...
Posted by StroiX on Sun, 02 Feb 2020 12:47:37 +0100
[java] RPC and RMI framework
Catalog
Summary
RMI Framework
register
MethodFactory
MethodDefinition
ProxyAnntotation
Server
RPCServer
ServerExecutor
ArgumentMaker
configuration file
Client
ClientProxy
ClientDialog
RPCClient
Load Balancing Interface
summary
Summary
RPC (Remote Procedure Call Protocol) A remote proced ...
Posted by xyzleft on Tue, 28 Jan 2020 07:32:42 +0100
The use of boost log Library
There is a log library for developers to use in boost, but the efficiency is not the highest:
Add the header file "include < boost / log / trial. HPP > to import the log Library
The log Library in boost has the following six levels:
BOOST_LOG_TRIVIAL(trace) << "A trace severity message" ...
Posted by phpyoungdeveloper on Mon, 27 Jan 2020 15:23:30 +0100
Rough learning SE
clone
protected Object clone()
Creates and returns a copy of this object.
protected Object clone() throws CloneNotSupportedException
All classes inherit Object, so all classes have clone() methods. But not all classes want to be cloned. They must support the clonable interface. This interface does ...
Posted by sixdollarshirt on Fri, 24 Jan 2020 11:01:42 +0100
JAVA - 61. Network connection
How the chat program works:
1. Client connects to server
2. The server establishes a connection and adds users to the guest list
3. Another user connects to the server
4. User a sends the information to user b through the server, and at the same time receives the reply from user b
[location server] use Socket or ip addres ...
Posted by sirfartalot on Wed, 22 Jan 2020 17:11:13 +0100
MySQL dual database construction
1. Build MySQL master-slave database
Refer to another blog post of the authorhttps://blog.csdn.net/weixin_37838921/article/details/104033403
2.MySQL dual machine environment
role
IP
OS/MySQL version
master1
192.168.11.10
CentOS7 / MySQL5.7
master2
192.168.11.30
CentOS7 / MySQL5.7
3. MyS ...
Posted by thegreatone2176 on Mon, 20 Jan 2020 09:33:42 +0100