摘要: 利用 Time.Ticker 实现一个定时器,并学习其源码。 阅读全文
posted @ 2022-04-22 22:47 鹿呦呦 阅读(2549) 评论(6) 推荐(0) 编辑
摘要: 学习WaitGroup源码,了解goroutine并发的实现。 阅读全文
posted @ 2022-01-09 02:55 鹿呦呦 阅读(420) 评论(0) 推荐(0) 编辑
摘要: Go 的通道有两种操作方式,一种是带 range 子句的 for 语句,另一种则是 select 语句,它是专门为了操作通道而存在的。这里主要介绍 select 的用法。 阅读全文
posted @ 2021-10-10 23:52 鹿呦呦 阅读(1615) 评论(0) 推荐(0) 编辑
摘要: 上一篇文章学习了协程(goroutine),go 关键字可以用来开启一个 goroutine 进行任务处理,而多个任务之间如果需要通信,就需要用到通道(channel)了。 阅读全文
posted @ 2021-08-24 01:46 鹿呦呦 阅读(2294) 评论(0) 推荐(0) 编辑
摘要: 学 Go 的时候知道 Go 语言支持并发,最简单的方法是通过 go 关键字开启 goroutine 即可。可在工作中,用的是 sync 包的 WaitGroup,然而这样还不够,当多个 goroutine 同时访问一个变量时,还要考虑如何保证这些 goroutine 之间不会相互影响,这就又使用到了 阅读全文
posted @ 2021-05-18 00:13 鹿呦呦 阅读(762) 评论(0) 推荐(1) 编辑
摘要: 图解大顶堆的构建、排序过程 阅读全文
posted @ 2020-05-31 00:42 鹿呦呦 阅读(19751) 评论(9) 推荐(9) 编辑
摘要: #442-Find All Duplicates in an Array-数组中重复的数字 阅读全文
posted @ 2020-05-25 00:57 鹿呦呦 阅读(359) 评论(0) 推荐(0) 编辑
摘要: PHP循环引用会遇到的坑 阅读全文
posted @ 2020-05-08 22:38 鹿呦呦 阅读(728) 评论(3) 推荐(0) 编辑
摘要: LeetCode#160-Intersection of Two Linked Lists-相交链表 阅读全文
posted @ 2020-04-22 22:43 鹿呦呦 阅读(377) 评论(2) 推荐(0) 编辑
摘要: 索引是在存储引擎层实现的,且在 MySQL 不同存储引擎中的实现也不同,本篇文章介绍的是 MySQL 的 InnoDB 的索引。 阅读全文
posted @ 2020-04-17 22:53 鹿呦呦 阅读(608) 评论(0) 推荐(1) 编辑
摘要: LeetCode#2-Add Two Numbers-两数相加 阅读全文
posted @ 2020-04-15 01:15 鹿呦呦 阅读(259) 评论(0) 推荐(1) 编辑
摘要: LeetCode#141-Linked List Cycle-环形链表 阅读全文
posted @ 2020-04-13 00:28 鹿呦呦 阅读(182) 评论(0) 推荐(0) 编辑
摘要: LeetCode#66-Plus One-加一 阅读全文
posted @ 2020-04-12 16:34 鹿呦呦 阅读(165) 评论(0) 推荐(0) 编辑
摘要: LeetCode#35-Search Insert Position-搜索插入位置 阅读全文
posted @ 2020-04-11 23:31 鹿呦呦 阅读(329) 评论(0) 推荐(0) 编辑
摘要: LeetCode#203-Remove Linked List Elements-移除链表元素 阅读全文
posted @ 2020-04-11 15:19 鹿呦呦 阅读(257) 评论(0) 推荐(0) 编辑