 如何消除程序中的数据竞争-周光远顺序3 非 预 期 状 态 goroutine 1 goroutine 2 Happens Before Happens Before关系是一种保证,如果a事件Happens Before b事件,那么b事件一定能观察到a事件的结果; In computer science, the happened-before is a relation between the result of two happen before another event, the result must reflect that, even if those events are in reality executed out of order. a b b c a c 传递性: 对于任意的事件a,b,c,如果a → b, 同时,b → c,则有: a → c. (后续用→ 代表happens before) before) • 观察意味着b事件对a事件的结果存在依赖; • Happens Before关系不代表代码真实执行的时间; • 真实执行的时间不影响Happens Before关系; Go语言的Happens Before Go 中的 happens before 有以下保证(https://golang.org/ref/mem): goroutine: a := 1 b := a c :=0 码力 | 30 页 | 1.92 MB | 1 年前3 如何消除程序中的数据竞争-周光远顺序3 非 预 期 状 态 goroutine 1 goroutine 2 Happens Before Happens Before关系是一种保证,如果a事件Happens Before b事件,那么b事件一定能观察到a事件的结果; In computer science, the happened-before is a relation between the result of two happen before another event, the result must reflect that, even if those events are in reality executed out of order. a b b c a c 传递性: 对于任意的事件a,b,c,如果a → b, 同时,b → c,则有: a → c. (后续用→ 代表happens before) before) • 观察意味着b事件对a事件的结果存在依赖; • Happens Before关系不代表代码真实执行的时间; • 真实执行的时间不影响Happens Before关系; Go语言的Happens Before Go 中的 happens before 有以下保证(https://golang.org/ref/mem): goroutine: a := 1 b := a c :=0 码力 | 30 页 | 1.92 MB | 1 年前3
 The Rust Programming Language,2nd Editionyou how to run a newly created program. We’ll break that process down and examine each step now. Before running a Rust program, you have to compile it. You can use the Rust compiler by entering the rustc it just ran the binary. If you had modified your source code, Cargo would have rebuilt the project before running it, and you would have seen something like this: $ cargo run Compiling hello_cargo v0.1 rapidly iterate on a project, and this game is such a project: we want to quickly test each iteration before moving on to the next one. Reopen the src/main.rs file. You’ll be writing all the code in this file0 码力 | 617 页 | 1.54 MB | 1 年前3 The Rust Programming Language,2nd Editionyou how to run a newly created program. We’ll break that process down and examine each step now. Before running a Rust program, you have to compile it. You can use the Rust compiler by entering the rustc it just ran the binary. If you had modified your source code, Cargo would have rebuilt the project before running it, and you would have seen something like this: $ cargo run Compiling hello_cargo v0.1 rapidly iterate on a project, and this game is such a project: we want to quickly test each iteration before moving on to the next one. Reopen the src/main.rs file. You’ll be writing all the code in this file0 码力 | 617 页 | 1.54 MB | 1 年前3
 User’s Guide for Free Pascal, Version 3.2.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2 Installing the compiler 10 2.1 Before Installation : Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.1.1 Hardware Optional configuration steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.4 Before compiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.5 Testing michael@freepascal.org. . Let’s get on with something useful. 9 Chapter 2 Installing the compiler 2.1 Before Installation : Requirements 2.1.1 Hardware requirements The compiler needs at least one of the0 码力 | 217 页 | 756.57 KB | 1 年前3 User’s Guide for Free Pascal, Version 3.2.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2 Installing the compiler 10 2.1 Before Installation : Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.1.1 Hardware Optional configuration steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.4 Before compiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.5 Testing michael@freepascal.org. . Let’s get on with something useful. 9 Chapter 2 Installing the compiler 2.1 Before Installation : Requirements 2.1.1 Hardware requirements The compiler needs at least one of the0 码力 | 217 页 | 756.57 KB | 1 年前3
 Click Documentation
Release 4.2.dev0following command: $ deactivate After doing this, the prompt of your shell should be as familar as before. Now, let’s move on. Enter the following command to get Click activated in your virtualenv: $ pip applications through setuptools. I strongly recommend to have a look at the Setuptools Integration chapter before reading the rest as the examples assume that you will be using setuptools. 1.3 Setuptools Integration entry_points parameter. Below console_scripts, each line identifies one console script. The first part before the equals sign (=) is the name of the script that should be generated, the second part is the import0 码力 | 101 页 | 407.32 KB | 1 年前3 Click Documentation
Release 4.2.dev0following command: $ deactivate After doing this, the prompt of your shell should be as familar as before. Now, let’s move on. Enter the following command to get Click activated in your virtualenv: $ pip applications through setuptools. I strongly recommend to have a look at the Setuptools Integration chapter before reading the rest as the examples assume that you will be using setuptools. 1.3 Setuptools Integration entry_points parameter. Below console_scripts, each line identifies one console script. The first part before the equals sign (=) is the name of the script that should be generated, the second part is the import0 码力 | 101 页 | 407.32 KB | 1 年前3
 Click Documentation Release 3.3following command: $ deactivate After doing this, the prompt of your shell should be as familar as before. Now, let’s move on. Enter the following command to get Flask activated in your virtualenv: $ pip applications through setuptools. I strongly recommend to have a look at the Setuptools Integration chapter before reading the rest as the examples assume that you will be using setuptools. 1.3 Setuptools Integration entry_points parameter. Below console_scripts, each line identifies one console script. The first part before the equals sign (=) is the name of the script that should be generated, the second part is the import0 码力 | 95 页 | 387.75 KB | 1 年前3 Click Documentation Release 3.3following command: $ deactivate After doing this, the prompt of your shell should be as familar as before. Now, let’s move on. Enter the following command to get Flask activated in your virtualenv: $ pip applications through setuptools. I strongly recommend to have a look at the Setuptools Integration chapter before reading the rest as the examples assume that you will be using setuptools. 1.3 Setuptools Integration entry_points parameter. Below console_scripts, each line identifies one console script. The first part before the equals sign (=) is the name of the script that should be generated, the second part is the import0 码力 | 95 页 | 387.75 KB | 1 年前3
 Undefined Behavior: What Every Programmer Should Know and Fearit bool f(int i) { return i + 1 > i; } // Example 01 ● Signed integer overflow is UB ● UB never happens (compiler is not required to condone UB) ● i != INT_MAX ● i + 1 is always greater than i bool g(int it bool f(int i) { return i + 1 > i; } // Example 01 ● Signed integer overflow is UB ● UB never happens (compiler is not required to condone UB) ● i != INT_MAX ● i + 1 is always greater than i bool g(int int i = 1; int main() { cout << "Before" << endl; while (i) {} cout << "After" << endl; } ● GCC, O3: prints “Before” and hangs ● CLANG, O3: prints “Before”, “After”, and exitsUndefined Behavior0 码力 | 38 页 | 2.56 MB | 6 月前3 Undefined Behavior: What Every Programmer Should Know and Fearit bool f(int i) { return i + 1 > i; } // Example 01 ● Signed integer overflow is UB ● UB never happens (compiler is not required to condone UB) ● i != INT_MAX ● i + 1 is always greater than i bool g(int it bool f(int i) { return i + 1 > i; } // Example 01 ● Signed integer overflow is UB ● UB never happens (compiler is not required to condone UB) ● i != INT_MAX ● i + 1 is always greater than i bool g(int int i = 1; int main() { cout << "Before" << endl; while (i) {} cout << "After" << endl; } ● GCC, O3: prints “Before” and hangs ● CLANG, O3: prints “Before”, “After”, and exitsUndefined Behavior0 码力 | 38 页 | 2.56 MB | 6 月前3
 Click Documentation
Release 6.7following command: $ deactivate After doing this, the prompt of your shell should be as familar as before. Now, let’s move on. Enter the following command to get Click activated in your virtualenv: $ pip applications through setuptools. I strongly recommend to have a look at the Setuptools Integration chapter before reading the rest as the examples assume that you will be using setuptools. 1.3 Setuptools Integration entry_points parameter. Below console_scripts, each line identifies one console script. The first part before the equals sign (=) is the name of the script that should be generated, the second part is the import0 码力 | 107 页 | 428.42 KB | 1 年前3 Click Documentation
Release 6.7following command: $ deactivate After doing this, the prompt of your shell should be as familar as before. Now, let’s move on. Enter the following command to get Click activated in your virtualenv: $ pip applications through setuptools. I strongly recommend to have a look at the Setuptools Integration chapter before reading the rest as the examples assume that you will be using setuptools. 1.3 Setuptools Integration entry_points parameter. Below console_scripts, each line identifies one console script. The first part before the equals sign (=) is the name of the script that should be generated, the second part is the import0 码力 | 107 页 | 428.42 KB | 1 年前3
 Click Documentation
Release 5.2.dev0following command: $ deactivate After doing this, the prompt of your shell should be as familar as before. Now, let’s move on. Enter the following command to get Click activated in your virtualenv: $ pip applications through setuptools. I strongly recommend to have a look at the Setuptools Integration chapter before reading the rest as the examples assume that you will be using setuptools. 1.3 Setuptools Integration entry_points parameter. Below console_scripts, each line identifies one console script. The first part before the equals sign (=) is the name of the script that should be generated, the second part is the import0 码力 | 103 页 | 416.61 KB | 1 年前3 Click Documentation
Release 5.2.dev0following command: $ deactivate After doing this, the prompt of your shell should be as familar as before. Now, let’s move on. Enter the following command to get Click activated in your virtualenv: $ pip applications through setuptools. I strongly recommend to have a look at the Setuptools Integration chapter before reading the rest as the examples assume that you will be using setuptools. 1.3 Setuptools Integration entry_points parameter. Below console_scripts, each line identifies one console script. The first part before the equals sign (=) is the name of the script that should be generated, the second part is the import0 码力 | 103 页 | 416.61 KB | 1 年前3
 Building a Coroutine-Based Job System Without Standard LibraryWhat do we do? Before we get started, just a quick self introduction about my background, I am a real-time rendering engineer at NVIDIA working on the RTX renderer in Omniverse. Before that, I was rendering functions are compiled More resources: https://gist.github.com/MattPD/9b55db49537a90545a90447392ad3aeb Before we dive into the system, I want to take 10 mins to have a quick recap about C++ coroutine and share expression into code. 1. Retreive awaiter & awaitable 2. Awaiting the awaiter(suspend and resume happens here) Awaitable & awaiter & co_await Useful to know • According to the definition, a type can0 码力 | 120 页 | 2.20 MB | 6 月前3 Building a Coroutine-Based Job System Without Standard LibraryWhat do we do? Before we get started, just a quick self introduction about my background, I am a real-time rendering engineer at NVIDIA working on the RTX renderer in Omniverse. Before that, I was rendering functions are compiled More resources: https://gist.github.com/MattPD/9b55db49537a90545a90447392ad3aeb Before we dive into the system, I want to take 10 mins to have a quick recap about C++ coroutine and share expression into code. 1. Retreive awaiter & awaitable 2. Awaiting the awaiter(suspend and resume happens here) Awaitable & awaiter & co_await Useful to know • According to the definition, a type can0 码力 | 120 页 | 2.20 MB | 6 月前3
 Back to Basics: Pointersstoring an int with value 7 ● Here we see ‘px’ again ● And we see an ‘asterisk’ before px ○ When an asterisk is before the variable name (and the type is a pointer), it means to retrieve the value at storing an int with value 7 ● Here we see ‘px’ again ● And we see an ‘asterisk’ before px ○ When an asterisk is before the variable name (and the type is a pointer), it means to retrieve the value at addresses (8/11) 36 ● Okay, so what happens with our pointer? ○ int x= 7; ○ int* px= &x; 7Visualizing Memory - Linear array of addresses (9/11) 37 ● Okay, so what happens with our pointer? ○ int x= 7;0 码力 | 152 页 | 5.61 MB | 6 月前3 Back to Basics: Pointersstoring an int with value 7 ● Here we see ‘px’ again ● And we see an ‘asterisk’ before px ○ When an asterisk is before the variable name (and the type is a pointer), it means to retrieve the value at storing an int with value 7 ● Here we see ‘px’ again ● And we see an ‘asterisk’ before px ○ When an asterisk is before the variable name (and the type is a pointer), it means to retrieve the value at addresses (8/11) 36 ● Okay, so what happens with our pointer? ○ int x= 7; ○ int* px= &x; 7Visualizing Memory - Linear array of addresses (9/11) 37 ● Okay, so what happens with our pointer? ○ int x= 7;0 码力 | 152 页 | 5.61 MB | 6 月前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100














 
  
 