• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
孙龙 程序员
少时总觉为人易,华年方知立业难
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 75 下一页
2022年5月18日
php后台管理系统laravel7.2以上异常发送钉钉告警提醒
摘要: 1,\app\Http\Middleware\目录下新增文件Monitor.php <?php namespace App\Http\Middleware; use Error; use Closure; use Exception; use Illuminate\Http\Request; use 阅读全文
posted @ 2022-05-18 16:23 孙龙-程序员 阅读(130) 评论(0) 推荐(0)
2022年5月16日
golang wire 依赖注入
摘要: 一.假设需要定义多个有依赖的启动项(代码如下) package main import ("fmt") type Message string func NewMessage() Message { return Message("Hi there!") } type Event struct { 阅读全文
posted @ 2022-05-16 18:55 孙龙-程序员 阅读(344) 评论(0) 推荐(0)
2022年5月15日
go并行编程4-context
摘要: context 在 Go 服务中,每个传入的请求都在其自己的goroutine 中处理。请求处理程序通常启动额外的 goroutine 来访问其他后端,如数据库和 RPC 服务。处理请求的 goroutine 通常需要访问特定于请求(request-specific context)的值,例如最终用 阅读全文
posted @ 2022-05-15 17:24 孙龙-程序员 阅读(122) 评论(0) 推荐(0)
2022年5月13日
进程、线程和协程有什么区别
摘要: 面试官常问的线程 ,进程,协程 阅读全文
posted @ 2022-05-13 16:00 孙龙-程序员 阅读(1305) 评论(1) 推荐(2)
2022年5月12日
程序员多人协作开发记一次解决git合并解决全文冲突的问题
摘要: 多人开发项目代码冲突解决 阅读全文
posted @ 2022-05-12 17:19 孙龙-程序员 阅读(206) 评论(0) 推荐(0)
2022年4月13日
gobing并行编程3-sync
摘要: 传统的线程模型(通常在编写 Java、C++ 和Python 程序时使用)程序员在线程之间通信需要使用共享内存。通常,共享数据结构由锁保护,线程将争用这些锁来访问数据。 在某些情况下,通过使用线程安全的数据结构(如 Python 的Queue),这会变得更容易。 Go 的并发原语 goroutine 阅读全文
posted @ 2022-04-13 18:17 孙龙-程序员 阅读(186) 评论(0) 推荐(0)
2022年4月12日
Go Concurrency Patterns: Pipelines and cancellation
摘要: Sameer Ajmani13 March 2014 Introduction Go’s concurrency primitives make it easy to construct streaming data pipelines that make efficient use of I/O 阅读全文
posted @ 2022-04-12 14:40 孙龙-程序员 阅读(43) 评论(0) 推荐(0)
Go Concurrency Patterns: Timing out, moving on
摘要: Andrew Gerrand23 September 2010 Concurrent programming has its own idioms. A good example is timeouts. Although Go’s channels do not support them dire 阅读全文
posted @ 2022-04-12 14:37 孙龙-程序员 阅读(57) 评论(0) 推荐(0)
2022年4月8日
golang 详解协程——errgroup
摘要: 我们把一个复杂的任务,尤其是依赖多个微服务 rpc 需要聚合数据的任务,分解为依赖和并行,依赖的意思为: 需要上游 a 的数据才能访问下游 b 的数据进行组合。但是并行的意思为: 分解为多个小任务并行执行,最终等全部执行完毕。 https://pkg.go.dev/golang.org/x/sync 阅读全文
posted @ 2022-04-08 17:43 孙龙-程序员 阅读(1172) 评论(0) 推荐(0)
2022年3月27日
go并行编程-2-内存模型
摘要: https://golang.org/ref/mem 如何保证在一个 goroutine 中看到在另一个 goroutine 修改的变量的值,如果程序中修改数据时有其他 goroutine 同时读取,那么必须将读取串行化。为了串行化访问,请使用 channel 或其他同步原语,例如 sync 和 s 阅读全文
posted @ 2022-03-27 16:46 孙龙-程序员 阅读(68) 评论(0) 推荐(0)
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 75 下一页
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3