Related concepts of process and thread

Thread and process concepts: Process: Process is the basic unit of resource (CPU, memory, etc.) allocation. It is an instance of program execution.When the program runs, the system will create a process, allocate resources for it, and then put the process into the process ready queueWhen the process scheduler selects it, it will allocate C ...

Posted by idealbrain on Mon, 10 Jan 2022 15:17:12 +0100

JUC concurrent programming -- Interpretation of AQS source code

catalogue 1. What is AQS 2. Use of LockSupport 3. Analyze AQS source code with ReentrantLock Unfair locking operation Release lock operation 1. What is AQS AQS(AbstractQueuedSynchronizer) is a framework used to build locks and synchronizers. Using AQS can easily and efficiently construct a large number of synchronizers widely used, su ...

Posted by matthew798 on Sat, 08 Jan 2022 13:08:11 +0100

Principle of java locks

concept 1. java objects Object header (Object header) 12byte. Object header is composed of Mark word (8byte) and Klass pointer (turn on pointer compression size is 4 byte, pointer to object's metadata, pointer to template of method area class class class). Aligned bytes (consisting of instance data of the object and byte alignment. Because ...

Posted by hungryOrb on Tue, 04 Jan 2022 16:42:55 +0100

[Java Concurrent Programming Series 8] multithreading practice

Mainly based on the recent multi-threaded project of Xiaomi, extract the multi-threaded instances inside. Yesterday, I was shocked to hear the news of the death of old yuan. I was shocked by the fall of a generation of superstars. I hope old yuan can be well in heaven. I posted a picture of old yuan. This picture also reminds me of m ...

Posted by chick3n on Mon, 03 Jan 2022 02:07:51 +0100

Multithreading and high concurrency section 1, summary of classroom knowledge 21.08.01

Understanding concurrency and parallelism Concurrency refers to the execution of multiple tasks at the same time for a CPU - in essence, it is divided into time slices. Because the time is very short, it gives the impression that it is executed at the same time; Parallel is for multiple CPUs to execute multiple tasks at the same time (one ...

Posted by Ollie Saunders on Sun, 02 Jan 2022 18:20:28 +0100

Timer class principle analysis, task execution delay

API The Timer class is used to delay the execution of a task. schedule(TimerTask task, **long **delay) to specify the delay timeSchedule (TimerTask, date time), specify the timeschedule(TimerTask task, **long **delay, **long **period), specify the delay time and repetition periodSchedule (TimerTask task, date, firsttime, * * long * * period), ...

Posted by mazen on Sun, 02 Jan 2022 11:06:57 +0100

03 - collect thread safety, lock, Callable, JUC auxiliary classes

catalogue 1. List collection thread safety 2.HashSet set thread safety 3.HashMap collection thread safety 4. Eight questions 5. Fair lock and unfair lock 6. Re entrant lock 7. Deadlock 8.Callable interface FutureTask 9.JUC auxiliary class 9.1 CountDownLatch decrease count 9.2 CyclicBarrier 9.3 Semaphore semaphore 1. List collec ...

Posted by iluv8250 on Sun, 02 Jan 2022 01:17:17 +0100

Concurrent programming learning notes -- Concurrent Design Pattern

Immutability pattern: how to use invariance to solve concurrency problems? There is a concurrency problem when multiple threads read and write the same shared variable at the same time If you only read, but not write, there is no concurrency problem In fact, the simplest way to solve the concurrency problem is to let shared variables have only ...

Posted by kaser on Sat, 01 Jan 2022 23:00:07 +0100

[Java Concurrent Programming Series 9] lock

It mainly explains the common locks in Java. preface The series of concurrent programming should be coming to an end. Locks may be the last article in this series, and important basic knowledge should be covered. Then, for the last few chapters of the book "practical combat of Java Concurrent Programming", I only read the loc ...

Posted by tommy1987 on Wed, 29 Dec 2021 21:41:51 +0100

[multithreading and high concurrency] 4-AQS & strong weak virtual

AQS(CLH) Bottom layer: CAS+volatile graphic The core of aqs is a state (volatile) and a two-way linked list that monitors the state. Each linked list has a node and each node is loaded with threads. If each thread wants to obtain a lock and wait, it must enter the waiting queue. (when adding the tail of the queue, we should pay attention to the ...

Posted by PaulRyan on Wed, 29 Dec 2021 05:21:26 +0100