mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-05-24 12:32:21 +00:00
ch1.6: 规范化图像编号
This commit is contained in:
parent
c2703096fb
commit
18a4a72f9c
@ -416,7 +416,10 @@ func main() {
|
|||||||
|
|
||||||
在“Hello world 的革命”一节中,我们为了演示Newsqueak的并发特性,文中给出了并发版本素数筛的实现。并发版本的素数筛是一个经典的并发例子,通过它我们可以更深刻地理解Go语言的并发特性。“素数筛”的原理如图:
|
在“Hello world 的革命”一节中,我们为了演示Newsqueak的并发特性,文中给出了并发版本素数筛的实现。并发版本的素数筛是一个经典的并发例子,通过它我们可以更深刻地理解Go语言的并发特性。“素数筛”的原理如图:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
*图 1.6-1 素数筛*
|
||||||
|
|
||||||
|
|
||||||
我们需要先生成最初的`2, 3, 4, ...`自然数序列(不包含开头的0、1):
|
我们需要先生成最初的`2, 3, 4, ...`自然数序列(不包含开头的0、1):
|
||||||
|
|
||||||
|
BIN
images/ch1.6-1-prime-sieve.png
Normal file
BIN
images/ch1.6-1-prime-sieve.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.8 KiB |
Loading…
x
Reference in New Issue
Block a user