当前位置:网站首页>Distributed solution - Comprehensive decryption of distributed task scheduling platform -xxljob
Distributed solution - Comprehensive decryption of distributed task scheduling platform -xxljob
2022-07-05 12:32:00 【vx-Yang_ Gaige】
What is a scheduled task
Assign a time to perform the task
Java The way to achieve scheduled tasks
Thread
public class Demo01 {
static long count = 0;
public static void main(String[] args) {
Runnable runnable = new Runnable() {
@Override
public void run() {
while (true) {
try {
Thread.sleep(1000);
count++;
System.out.println(count);
} catch (Exception e) {
// TODO: handle exception
}
}
}
};
Thread thread = new Thread(runnable);
thread.start();
}
}
TimerTask
/**
* Use TimerTask Class to implement timed tasks
*/
public class Demo02 {
static long count = 0;
public static void main(String[] args) {
TimerTask timerTask = new TimerTask() {
@Override
public void run() {
count++;
System.out.println(co边栏推荐
- Leetcode-1. Sum of two numbers (Application of hash table)
- Intern position selection and simplified career development planning in Internet companies
- Four operations and derivative operations of MATLAB polynomials
- MySQL splits strings for conditional queries
- Solve the problem of cache and database double write data consistency
- Error modulenotfounderror: no module named 'cv2 aruco‘
- Video networkstate property
- Ecplise development environment configuration and simple web project construction
- Basic operations of MySQL data table, addition, deletion and modification & DML
- Select drop-down box realizes three-level linkage of provinces and cities in China
猜你喜欢
Automated test lifecycle

Anaconda creates a virtual environment and installs pytorch

Redis highly available sentinel mechanism

ABAP table lookup program

MySQL index (1)

Understand redis persistence mechanism in one article

Mmclassification training custom data

Pytorch two-layer loop to realize the segmentation of large pictures

Knowledge representation (KR)

Resnet18 actual battle Baoke dream spirit
随机推荐
嵌入式软件架构设计-消息交互
End to end neural network
Keras implements verification code identification
GNN(pytorch-geometric)
Correct opening method of redis distributed lock
Matlab boundarymask function (find the boundary of the divided area)
PIP command reports an error pip is configured with locations that requires tls/ssl problems
Pytoch counts the number of the same elements in the tensor
Matlab label2idx function (convert the label matrix into a cell array with linear index)
Anaconda creates a virtual environment and installs pytorch
Tabbar configuration at the bottom of wechat applet
Detailed structure and code of inception V3
16 channel water lamp experiment based on Proteus (assembly language)
Recyclerview paging slide
Video networkstate property
Knowledge representation (KR)
JS for loop number exception
[figure neural network] GNN from entry to mastery
Halcon template matching actual code (I)
语义分割实验:Unet网络/MSRC2数据集