JAVA learning thread, synchronization

Chapter 1 Principles of Multithreading

 

1.1 Thread class

 

 

 

1.2 Ways to create threads 

 

 

 1.3 The difference between Thread and Runnable


 

 

 

 

Chapter 2 Thread Safety

 

2.1 Thread safety

When sharing the same resources, often different results than expected.

 

2.2 Thread synchronization (There are three ways to solve the problem of thread synchronization)

 

 

 About lock

 

 

 

 

 


 

 

 Chapter 3 Thread Status

 

 

 3.1 Time waiting

 sleep(long a)

 wait (long a)

 

3.2 Infinite wait

 object.wait()

 object.notify()

 

 

 

Guess you like

Origin www.cnblogs.com/honghui-cai/p/12704497.html