007 Linux fork() function

Foreword This article will introduce you to the fork function in the form of questions. Article highlights Regarding the fork function, this article focuses on solving the following questions Question 1: Why is the code before the fork only executed by the parent process, but the code after the fork is executed by both the […]

Lab 6: Copy-on-write fork

Lab 6: Copy-on-write fork COW fork() creates just a pagetable for the child, with PTEs for user memory pointing to the parent’s physical pages. COW fork() marks all the user PTEs in both parent and child as not writable. When either process tries to write one of these COW pages, the CPU will force a […]

How ForkJoinPool works

The idea of divide and conquer Decompose a problem of size N into K sub-problems of smaller size, which are independent of each other and have the same properties as the original problem. By finding the solution to the subproblem, you can get the solution to the original problem. step: Decomposition: Divide the problem to […]

11Fork/Join

Table of Contents 1 Divide and conquer thinking 2Fork/Join 2.1 Introduction 2.2 Application scenarios 1 Recursive decomposition task 2 Array processing 3 Parallelization Algorithm 4 Big data processing 2.3 Use 2.3.1 ForkJoinPool Constructor Task submission method Compared with ordinary thread pool 2.3.2 ForkJoinTask call method 2.3.3 Handling recursive tasks 2.3.4 Handling blocking tasks 2.4 Principles […]

19. ForkJoin application examples

1. Preface In the previous section, we learned the basic concepts and core API of ForkJoin. This section will lead you to implement a specific application case. Experience the use of the ForkJoin framework from practical applications and the convenience brought by this framework. This section first describes the content of the case to be […]

Concurrent programming-thread pool ForkJoinPool (2)

Fork/Join framework introduction What is Fork/Join Fork/Join is a parallel computing framework, mainly used to support the divide and conquer task model. Fork corresponds to task decomposition in the divide-and-conquer task model, and Join corresponds to result merging. The core idea: Divide a large task into many small tasks, then execute these small tasks in […]

Concurrent programming-thread pool ForkJoinPool

ForkJoinPool Algorithm question: How to make full use of the performance of multi-core CPUs to quickly sort an array of 20 million sizes? Divide and conquer thinking: decompose, solve, merge The idea of divide and conquer is to decompose a problem of size N into K sub-problems of smaller size, which are independent of each […]

JUC concurrent programming – ForkJoin and asynchronous callbacks

ForkJoin (branch merge) What is ForkJoin ForkJoin appeared in JDK1.7, executing tasks in parallel, which can improve efficiency under large data volume An explanation provided by iFlytek Spark: Forkjoin is a parallel computing algorithm that is used to decompose a large task into multiple small tasks, then assign these small tasks to different threads or […]