Overview of Java Multithreading

Multi-threading concept Concurrency|concurrency Parallel: Multiple instructions executed simultaneously on multiple CPU sConcurrent: Multiple instructions executed alternately on a single CPU Process|Thread Processes: Processes in progress such as: word Independence: An independent unit that runs, distributes, and schedules resources ind ...

Posted by webslinger on Thu, 16 Sep 2021 19:32:43 -0700

java-fair lock-re-lockable-deadlock-interrupt (how to gracefully stop a thread)

1. Fair-Unfair 1.1 Ticket Selling Cases (Unfair) class Ticket { private int number = 50; private Lock lock = new ReentrantLock(); //The default is an unfair lock. If you want an average allocation, =--, to be fair, change the constructor parameter to true public void sale() { lock.lock(); try { ...

Posted by SuperCam on Mon, 13 Sep 2021 20:06:10 -0700

Self-Organizing - Multi-threaded + JUC Notes

Thread Basics Programs, Processes, Threads, Fibers (Programs) Program: The.exe executable that was initially lying quietly on disk, load ed into memory by the system when we clicked Run, and executed by the cpu Processes: The basic unit for operating system resource allocation. (A program can be run by multiple processes, such as a computer ...

Posted by cabaz777 on Fri, 10 Sep 2021 20:43:24 -0700

Multi thread crawling NCBI database literature

Tip: after the article is written, the directory can be generated automatically. Please refer to the help document on the right for how to generate it preface Recently, I followed the dark horse programmer to learn the request crawler and successfully completed the batch processing of NCBI documents. The problem is that the crawling eff ...

Posted by dharprog on Thu, 09 Sep 2021 20:18:19 -0700