Xuanxuan Linux learning notes - process and thread

Reference materials: Bird brother's Linux private dishes: Basic Edition, Liu Chao's interesting talk about Linux operating system, UNIX/Linux system management technical manual, 4th Edition, in-depth understanding of Linux kernel, 3rd Edition, advanced programming in UNIX environment, 3rd Edition, Linux kernel source code scenario analys ...

Posted by WakeAngel on Sat, 04 Dec 2021 03:51:23 +0100

JUC learning - AbstractQueuedSynchronizer source code interpretation (AQS)

1, Understanding of AbstractQueuedSynchronizer AbstractQueuedSynchronizer Abstract queue synchronizer is called AQS for short. It is the basic component to implement the synchronizer. juc the following Lock implementation and some concurrency tool classes are implemented through AQS. AQS will form all request threads into a CLH queue. When a ...

Posted by Plug-in on Fri, 03 Dec 2021 13:04:56 +0100

Multithreaded Learning (V)

1. AQS The full name is AbstractQueuedSynchronizer, which is the framework for blocking locks and related synchronizer tools. It is characterized by the state attribute representing the state of the resource (exclusive and shared), and subclasses that define how to maintain this state and control how locks are acquired and released. 1. getState ...

Posted by wdseelig on Thu, 02 Dec 2021 01:12:55 +0100

JUC learning - delay queue details

1. Basic features of DelayQueue public class DelayQueue<E extends Delayed> extends AbstractQueue<E> implements BlockingQueue<E> DelayQueue delay queue has the characteristics of unbounded queue, blocking queue and priority queue. Let's look at the following separately: Unbounded queue: put the task object to be execute ...

Posted by bossman on Thu, 02 Dec 2021 00:30:43 +0100

Application of Write-time Replication in CopyOnWriteArrayList

Foreword: The code in this article is based on JDK1.8 ​ Thread Insecure List java.util.LinkedListjava.util.ArrayList ​ Thread-safe List java.util.VectorJava.util.Stack (a subclass of Vector that encapsulates Vectors and can only do a FIFO stack operation)Java.util.Collections.SynchronizedList (a static internal class in Collections)java ...

Posted by exhaler on Wed, 24 Nov 2021 18:24:12 +0100

Multithreaded server programming [2] - Essentials of thread synchronization

Four principles of thread synchronizationMinimum sharing of objects, reducing the need for synchronizationUse advanced concurrency components, such as TaskQueue, producer consumer queue, CountDownLatch, etcWhen you have to use the underlying synchronization primitive, only use non recursive mutexes and conditional variables. Use read-write lock ...

Posted by metuin on Tue, 23 Nov 2021 06:26:00 +0100

A line of Java code to exchange equipment in the game

Absrtact: since JDK 1.5, the exchange class provided under the JUC package can be used to exchange information between two threads. This article is shared from Huawei cloud community< One line of Java code enables two players to exchange equipment [concurrent programming] >, author: JavaLib of Chen PI. 1 what is exchange Since JDK 1.5 ...

Posted by Niccaman on Fri, 19 Nov 2021 06:26:23 +0100

A thorough understanding of the product of JUC divide and conquer thought of concurrency -- an analysis of the principle of ForkJoin branch merger framework Part II

introduction In< (12) A thorough understanding of the product of JUC divide and conquer thought of concurrency -- an analysis of the principle of ForkJoin branch merger framework part I >In, we had a preliminary understanding of the use of ForkJoin branch merging framework, and also analyzed the membership of the framework and the princi ...

Posted by *Lynette on Sun, 07 Nov 2021 01:34:32 +0100

C++11 concurrency and multithreading note taking singleton design pattern share data analysis, solution, call_once

1. About design patterns Design pattern Some writing methods of the code (these writing methods are different from the conventional writing methods), so that the program written by the code is flexible and easy to maintain, but others take over and read the code is very painful.The code written with the concept of "design patter ...

Posted by ksandom on Sat, 06 Nov 2021 23:00:11 +0100

C++11 concurrency and multithreading unique_lock details

1,unique_lock replaces lock_guard unique_lock Is a class template. In work, lock is generally used_ Guard (recommended); lock_guard replaces lock() and unlock() of mutex;unique_lock is better than lock_ The guard is much more flexible; The efficiency is a little poor, and the memory takes up a little more.In normal use, there is no d ...

Posted by naturalbeauty7 on Sat, 06 Nov 2021 08:16:43 +0100