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
Semaphore application (PV operation) - Classic PV operation
in this article, we focus on three classic examples of PV operation: producer consumer problem, reader writer problem and philosopher dining problem. These three problems will be analyzed layer by layer and continuously improved. I hope to have a deeper understanding of PV operation through this process.
producer consumer issues ...
Added by domwells27 on Mon, 31 Jan 2022 04:23:28 +0200
Experiment 15: multithreading scheduling
Experiment 15: multithreading scheduling
Corresponding to section 9.4 of p428
1. Relevant basic knowledge
2. Experimental records
2.1 experimental process
In the last experiment, the operation of a thread was realized: specifically 1. One physical page is applied as PCB 2.init_thread fills in the PCB structure located at the lowest address ...
Added by smallflower on Fri, 28 Jan 2022 14:51:17 +0200
shellecho, printf, test command and shell process control
1, echo command
Echo instruction is used for string output. Command format: echo string
1. Display normal string: echo "It is a test" or echo It is a test result: It is a test
2. Escape characters can also be displayed: echo "\"It is a test \ "" the result will be "It is a test"
3. Display varia ...
Added by gothica on Fri, 28 Jan 2022 08:57:15 +0200
MIT6.S081 ---- Lab cow
Lab cow
The problem
The fork system call in xv6 copies the user space memory of all the parent processes to the child processes. If the user space memory of the parent process is large, the replication will be time-consuming. Sometimes this copy is unnecessary. If the child process calls exec after fork, the copied memory will be released, and ...
Added by boonika on Wed, 26 Jan 2022 14:06:02 +0200
CAS operation and underlying implementation of JUC concurrent programming
concept
The full name of CAS is Compare And Swap, which means compare and exchange. It is the atomic operation of CPUCAS is an abstract idea, not a concrete implementationCAS operation has three parameters: memory address of the value to be modified, expected value and new valueThe main idea is to judge whether the value of a location in memor ...
Added by crash58 on Wed, 26 Jan 2022 06:06:35 +0200
Operating system simulation experiment
To get straight to the point, this article shares with you a code developed by me, which mainly realizes several small experiments of online simulation operating system. It can be said to be an online simulation platform (project files can be downloaded by myself when they are transmitted to resources, and I can also get private stamps)
Projec ...
Added by bpopp on Mon, 24 Jan 2022 19:51:39 +0200
Interprocess communication - Pipeline
Introduction to interprocess communication
Purpose of interprocess communication
Data transfer: one process needs to send its data to another processResource sharing: multiple processes share the same resources.Notification event: a process needs to send a message to another process or group of processes to notify it (them) of an event ...
Added by Petsmacker on Mon, 24 Jan 2022 14:44:36 +0200
Process synchronization and mutual exclusion: LINUX Environment
1, Purpose of the experiment: 1. Master basic synchronization and mutual exclusion algorithms and understand P and V operations. 2. Understand the producer consumer model and other typical synchronous and mutually exclusive models, such as philosopher dining, reader writer model, etc. 3. Understand the implementation method of process synchroni ...
Added by tonymontana on Sun, 23 Jan 2022 17:56:05 +0200
[xv6 source code snooping] mmap
prefaceThis article is about MIT 6 Implementation of s081-2020-lab10 (MMAP);If you find any problems in the content, please don't save your keyboard.preparationMMAP () and munmap() are two system calls that are only available in UNIX like systems. This experiment is only modeled on the function (toy) of realizing some of its file memory mapping ...
Added by kungfu71186 on Sun, 23 Jan 2022 15:05:45 +0200