concurrency2.0

command
v0.0.0-...-419a547 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

并发编程

子程序

  1. 检查cpu核数 main.go
  2. 互斥锁 lock.go
  3. 通道 channel.go
  4. 协程+通道 routineChannel.go
  5. 通道监听(label/select/case) select.go
  6. 异常捕捉(defer/panic) deferPanic.go
  7. 生产者消费者 producerConsumer.go
  8. 定时器(timer) timer.go
  9. 定时任务(ticker) scheduleTask.go
  10. 任务队列(timer/ticker) taskQueue.go

使用

# 模块
go mod init xx

# 依赖
go mod tidy

# 单个运行
go run xx.go 或 go build xx.go + ./xx.exe

# 整体运行
go build . 然后 ./xx.exe

# 检查资源竞争
go build -race xx.go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL