Rocket MQ Series II - producer principle
Producer principle
Producer overview
The party sending the message is called the producer. His role in the entire RocketMQ production and consumption system is shown in the figure:
Producer group: a logical concept. When using producer instances, you need to specify a group name. A ...
Posted by jayskates on Tue, 16 Nov 2021 07:31:23 -0800
Java multithreading -- ReentrantLock -- use / example / principle
Original website: Java multithreading -- ReentrantLock -- use / example / principle_ CSDN blog
brief introduction
explain
This article introduces ReentrantLock (reentrant exclusive lock) in Java's JUC. Including: usage and principle.
summary
ReentrantLock is mainly implemented ...
Posted by mailtome on Mon, 08 Nov 2021 14:26:51 -0800
Linux multithreaded server programming notes-1
Thread safe object creation, callback and Deconstruction in C + +It is not difficult to write thread safe classes. You can use synchronization primitives to protect the internal stateMost STL classes are not thread safe and need to be locked externally to ensure simultaneous access by multiple threadsSecure object creationThe only requirement i ...
Posted by Rottingham on Mon, 08 Nov 2021 01:24:48 -0800
Summary of Java multithreading Basics
< ------------------------------------------------------ Liao Xuefeng learns Java ---------------------------------------- >
1. Multithreading Basics
The computer calls a task a process, the browser is a process, and the video player is another process. Similarly, both the music player and Word are processesSubtasks in a process are ...
Posted by amalosoul on Sun, 07 Nov 2021 20:18:43 -0800
Multithreaded learning
1, Java Memory Model JMM is the Java Memory Model, which defines the abstract concepts of main memory and working memory. The bottom layer corresponds to CPU register, cache, hardware memory, CPU instruction optimization, etc. JMM is reflected in the following aspects: 1. Atomicity - ensure that the instruction will not be affected by thread co ...
Posted by miro on Sun, 07 Nov 2021 14:33:22 -0800
2, Concurrent programming - the underlying knowledge of threads (visibility, ordering, atomicity)
1. Visibility between threads
Multithreading improves efficiency and caches data locally, making data modification invisible,
To ensure visibility, either trigger synchronization instructions or add volatile modified memory. As long as there are modifications, synchronize each thread involved immediately
/**
* volatile Keyword to make a var ...
Posted by Houdini on Sat, 06 Nov 2021 13:27:44 -0700
C++11 concurrency and multithreading notes async, future, packaged_task,promise
1. std::async and std::future create background tasks and return values
1.1 std::async
std::async is a function template used to start an asynchronous task. After starting an asynchronous task, it returns an std::future object. std::future is a class template.Start an asynchronous task: create a thread and start executing the correspondin ...
Posted by DoddsAntS on Sat, 06 Nov 2021 01:54:01 -0700
[java basics] thread life cycle, two methods of creation and use, and thread synchronization
catalogue
1, Concept
1. Program, process, thread
2, Creation and use of threads
1. By inheriting the Thread class
2. By implementing the Runnable interface:
3. Related methods in Thread class
4. Thread priority
3, Thread life cycle
1. Several states of threads
4, Thread synchronization
1. Synchronous code block
...
Posted by mooshuligan on Sat, 06 Nov 2021 00:29:16 -0700
Timer timer use
1, Timer timer basic usage
Timer timer = new Timer(); timer.schedule(TimerTask, Date);, The task needs to be encapsulated with TimerTask, and the run method in TimerTask is rewrittenTimer timer = new Timer(boolean);, Passing a value of true indicates that the timer thread is a daemon thread, and the end of the main thread follows the end. Th ...
Posted by redtux on Fri, 05 Nov 2021 20:18:32 -0700
Linux thread scheduling strategy and priority experiment (picture and text)
Linux thread scheduling strategy and priority experiment
What is thread scheduling policy?
The Linux kernel has three scheduling algorithms:
1,SCHED_OTHER time-sharing scheduling strategy, 2,SCHED_FIFO real-time scheduling strategy, first come first serve 3,SCHED_RR, real-time scheduling strategy, time slice rotation
Where, SCHED_FIFO and S ...
Posted by giannis_athens on Thu, 04 Nov 2021 12:49:55 -0700