Python advanced notes
brief introduction
The basic notes introduce the basic problems such as data type and file operation. If you want to know more, you can take a look at the interviewThe advanced part mainly includes object-oriented idea, exception handling, iterator, generator and coroutine
object-oriented
Python has been an object-oriented language since ...
Posted by Teaky on Fri, 04 Mar 2022 11:32:25 +0100
Multithreaded interview - CountDownLatch, CyclicBarrier, Semaphore
0. Summary
1.CountDownLatch refers to one thread waiting for other threads, and CyclicBarrier refers to multiple threads waiting for each other; 2.CountDownLatch is the count - 1 until it is reduced to 0, and CyclicBarrier is the count + 1 until it reaches the specified value; 3.CountDownLatch is disposable and CyclicBarrier is recycled; 4.Cyc ...
Posted by XPertMailer on Fri, 04 Mar 2022 08:39:25 +0100
UC growth path 9
Review: UC growth path 1 UC growth path 2 UC growth path 3 UC growth path 4 UC growth path 5 UC growth path 6 UC growth path 7 UC growth path 8
1, Registration of last words function
atexit(3) review UC growth path 8on_exit(3)
#include <stdlib.h>
int on_exit(void (*function)(int , void *), void *arg);
//Function: register the last word ...
Posted by kapishi on Fri, 04 Mar 2022 05:06:14 +0100
JDK source code learning 06 currenthashmap analysis
JDK source code learning 06 currenthashmap analysis
The principle of CurrentHashMap is very complex. You can only record what you understand. As we all know, the thread safety implementation principle of CurrentHashMap is Synchronized+CAS. Now let's take a look.
Brief reading of notes
* Overview:
* The main design goal of this hash table is ...
Posted by nimzie on Fri, 04 Mar 2022 00:53:32 +0100
What do you call chicken ribs? Multiprocessing, multithreading, and coprocessing in Python
In the process of writing this article, we refer to the content of the course "Introduction to Python Programming and data science" by Mr. Hu Junfeng.
Concept:
Multiple tasks should be carried out simultaneously at one time, but not necessarily at the same time.Parallel: promote multiple tasks at the same time in a period of time, a ...
Posted by wonderman on Thu, 03 Mar 2022 13:14:01 +0100
C + + general lock management
lock_guard
Class lock_guard is a mutex wrapper that provides a convenient RAII style mechanism for occupying mutexes during scope blocks. Create lock_ When the guard object, it attempts to receive ownership of the given mutex. Control leave create lock_ Destroy lock when the scope of the guard object_ Guard and release mutex. lock_ The guard c ...
Posted by bqheath on Wed, 02 Mar 2022 16:16:04 +0100
[thread status, wait and wake-up, Lambda expression, Stream flow]
day09 [thread status, wait and wake-up, Lambda expression, Stream flow]
Today's content
Multithreading
Thread status -------- -- > must be masteredWaiting for wake-up mechanism -------- must be mastered Lambda expression
Usage scenarios of Lambda expressions -------- -- > it is recommended to masterFormat of Lambda expression (sta ...
Posted by boske on Wed, 02 Mar 2022 01:29:30 +0100
Linux producer consumer model
Producer consumer model
Concept of producer consumer model
Producer consumer model is to solve the strong coupling problem between producers and consumers through a container.
Producers and consumers do not communicate directly with each other, but communicate through this container. Therefore, after producing data, producers do not ...
Posted by Awanka on Sun, 27 Feb 2022 10:47:08 +0100
java multithreaded communication (mutual wake-up, circular printing) wait,notify cases and possible program blocking problems of false wake-up
1. Circular printing
public class OutWord {
private String word = "output A";
public synchronized void outA() throws InterruptedException {
if (word.equals("B output")){
this.wait();
}
//Output word
System.out.println("word = " + word);
word="B output";
this.notify();
} ...
Posted by rockofaith on Sat, 26 Feb 2022 06:20:49 +0100
Python multithreaded programming - queue class of 10 Queue module
Catalogue
1. Usage scenario of queue class
2. queue class
2.1. queue class constructor
2.2 queue class attributes and methods
3. queue.Queue usage scenario
3.1 creating queues
3.2 use the methods of empty(), full(), qsize() to check the queue status
3.3 use put(), put_ The nowait () method is inserted into the queue
3.4 using get(), ge ...
Posted by chinni_77 on Thu, 24 Feb 2022 06:25:10 +0100