Giter VIP home page Giter VIP logo

cache-example's Introduction

cache-example

《Go 语言编程之旅:一起用 Go 做项目》 第五章进程内缓存相关实例代码。

关于本书

本书涵盖 Go 语言的各大经典实战,不介绍 Go 语言的语法基础,内容面向项目实践,同时会针对核心细节进行分析。而在实际项目迭代中,常常会出现或多或少的事故,因此本书也针对 Go 语言的大杀器(分析工具)以及常见问题进行了全面讲解。

本书适合已经大致学习了 Go 语言的基础语法后,想要跨越到下一个阶段的开发人员,可以填补该阶段的空白和进一步拓展你的思维方向。

  • 作者:陈剑煜(煎鱼),GitHub:@eddycjy,微信公众号:脑子进煎鱼了。
  • 作者:徐新华(polaris),GitHub:@polaris,微信公众号:Go语言中文网。

购买链接

关注我

polarisxu 个人公众号

cache-example's People

Contributors

eddycjy avatar polaris1119 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cache-example's Issues

安装 bigCache 一直失败

老师请问一下, 为什么我按照书里面的命令安装bigCache 一直404, 不加版本号的话一直下载的是 1.2.1 版本, 加了 -u 参数也是, 加版本号完全下载不了最新的, 2.2.0 也不行, 用的七牛云的国内代理, 难道一定要科学上网才行吗?

FastCache datarace

如題所述,fast/shard.go好像怪怪的,是不是要用Lock而不是RLock?還是我誤解了什麼?

WARNING: DATA RACE
Read at 0x00c00014ed88 by goroutine 112:
  container/list.(*List).MoveToBack()
      /usr/local/go/src/container/list/list.go:197 +0x4b8
  test/fast.(*cacheShard).get()
      /home/runner/test/fast/shard.go:63 +0x12b
  test/fast.(*fastCache).Get()
      /home/runner/test/fast/cache.go:32 +0xd8
  test.BenchmarkT.func2()
      /home/runner/test/main_test.go:17 +0x90

Previous write at 0x00c00014ed88 by goroutine 58:
  container/list.(*List).move()
      /usr/local/go/src/container/list/list.go:131 +0x3e6
  container/list.(*List).MoveToBack()
      /usr/local/go/src/container/list/list.go:201 +0x20d
  test/fast.(*cacheShard).get()
      /home/runner/test/fast/shard.go:63 +0x12b
  test/fast.(*fastCache).Get()
      /home/runner/test/fast/cache.go:32 +0xd8
  test.BenchmarkT.func2()
      /home/runner/test/main_test.go:17 +0x90

Goroutine 112 (running) created at:
  test.BenchmarkT()
      /home/runner/test/main_test.go:16 +0xc3
  testing.(*B).runN()
      /usr/local/go/src/testing/benchmark.go:191 +0x1b4
  testing.(*B).launch()
      /usr/local/go/src/testing/benchmark.go:321 +0x15c

Goroutine 58 (finished) created at:
  test.BenchmarkT()
      /home/runner/test/main_test.go:16 +0xc3
  testing.(*B).runN()
      /usr/local/go/src/testing/benchmark.go:191 +0x1b4
  testing.(*B).launch()
      /usr/local/go/src/testing/benchmark.go:321 +0x15c
==================
==================
WARNING: DATA RACE
Read at 0x00c000148248 by goroutine 67:
  container/list.(*List).MoveToBack()
      /usr/local/go/src/container/list/list.go:197 +0x4b8
  test/fast.(*cacheShard).get()
      /home/runner/test/fast/shard.go:63 +0x12b
  test/fast.(*fastCache).Get()
      /home/runner/test/fast/cache.go:32 +0xd8
  test.BenchmarkT.func2()
      /home/runner/test/main_test.go:17 +0x90

Previous write at 0x00c000148248 by goroutine 51:
  [failed to restore the stack]

Goroutine 67 (running) created at:
  test.BenchmarkT()
      /home/runner/test/main_test.go:16 +0xc3
  testing.(*B).runN()
      /usr/local/go/src/testing/benchmark.go:191 +0x1b4
  testing.(*B).launch()
      /usr/local/go/src/testing/benchmark.go:321 +0x15c

Goroutine 51 (finished) created at:
  test.BenchmarkT()
      /home/runner/test/main_test.go:16 +0xc3
  testing.(*B).runN()
      /usr/local/go/src/testing/benchmark.go:191 +0x1b4
  testing.(*B).launch()
      /usr/local/go/src/testing/benchmark.go:321 +0x15c
........略

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.