Introduction to concurrent programming

  Preface: I believe everyone will use the Executors tool class to create a thread pool to use threads. Why does concurrent programming make the program faster? Then where is the difficulty? This article begins with an introduction to what concurrent programming is.

1. Concurrent programming

  The purpose of concurrent programming is to make the program run faster, but not starting more threads can maximize . When doing concurrent programming, if you want to make the program run faster by executing tasks in multiple threads, you will face many challenges, such as context switching problems, deadlock problems , and resource constraints limited by hardware and software.

 

  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324711738&siteId=291194637