Use of process Pool in combination with Queue queue in Manager
Process Pool:
When the number of sub processes to be created is small, you can directly use the Process in multiprocessing to dynamically generate multiple processes, but if it is hundreds of Process goals, the workload of manual creation will be very huge. At this time, you can use the Pool class in the multiprocessing module.
When initializ ...
Added by PowersWithin on Mon, 07 Feb 2022 08:51:23 +0200
Queue of data structure
What is a queue
A queue is a linear data structure. Different from the stack with the same linear data structure, the elements in the queue follow the First In First Out rule. Like queuing in reality, it pays attention to the principle of first come, first served. The exit end of the queue is called the front, and the entrance end of the queue ...
Added by boinnk on Sat, 05 Feb 2022 12:24:08 +0200
Data structure - heap
Concept: Heap is also called priority queue. When entering the queue, it is the same as ordinary queue, but when leaving the queue, the elements with higher priority are given priority. When the priority is the same, it is carried out in the way of first in first out. The essence of heap is actually a binary tree, and this binary tree needs to ...
Added by goatboy on Wed, 02 Feb 2022 10:38:41 +0200
The difference between Set and List in Java
Main differences between Set and List
Duplicate elements are allowed to be inserted in the List, while duplicate elements are not allowed in the Set.Related to the storage order of elements, List is an ordered Set, which will retain the order in which elements are inserted, and Set is an unordered Set.List can be accessed by subscript, but Set ...
Added by OMorchoe on Mon, 31 Jan 2022 14:21:17 +0200
5 minutes to understand - fair lock, unfair lock, reentry lock, spin lock, read-write lock
Fair lock and unfair lock
Fair lock It refers to that multiple threads acquire locks according to the order of applying for locks, and follow the principle of first come, first serve. Its implementation can use queues. Unfair lock The method of multiple threads acquiring locks is not in the order of applying for locks. The thread that ap ...
Added by balloontrader on Mon, 31 Jan 2022 12:53:02 +0200
Message Oriented Middleware -- message rejection
In the previous section, I learned how consumers get messages
So when consumers get the message and find that the message should not be solved by themselves, or an exception occurs during processing, how should they deal with it
This is the message rejection in this section
1, Message reject
There are also two ways to Reject messages: Rejec ...
Added by Lauj on Mon, 31 Jan 2022 02:18:59 +0200
PHP process and interprocess communication
environment
The process in php is completed in the form of extension. Through these extensions, we can easily complete a series of actions of the process.
pcntl extension: the main process extension, which completes the process creation in the waiting operation. posix extension: complete the general api of posix compatible machine, such as ob ...
Added by tomasd on Sun, 30 Jan 2022 18:11:11 +0200
[daily question] Leetcode:1765 The highest point in the map
Title Description
Give you an integer matrix isWater with the size of m x n, which represents a map composed of land and water cells.
If
i
s
W
a
t
e
...
Added by griemar on Sun, 30 Jan 2022 09:20:01 +0200
Recognize stacks and queues
Recognize stacks and queues
What is stack, JVM virtual machine stack and stack frame? ✌️
Stack: a linear table with limited operation, which is limited to linear tables with insertion and deletion operations only at the end of the table. This end is called the top of the stack, and the other end is called the bottom of the stack. Inserting a ...
Added by iwanpattyn on Sun, 30 Jan 2022 01:53:48 +0200
Interrupt tasklet -29 below
Interrupt the tasklet below
tasklet related knowledge points
What is a tasklet?
tasklet is a commonly used method for interrupt processing. tasklet is a special soft interrupt. The following mechanisms for handling interrupts include work queues and soft interrupts.
How to use tasklet s to design interrupts?
Interrupt occurrence, dealing w ...
Added by fezzik on Sun, 30 Jan 2022 01:47:48 +0200