Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

queue:使用list包中的LinkedList实现并发阻塞链式队列 #122

Merged
merged 7 commits into from
Nov 28, 2022

Conversation

kangdan6
Copy link
Contributor

再queue中增加并发阻塞链式队列

@codecov
Copy link

codecov bot commented Nov 24, 2022

Codecov Report

Merging #122 (efd1220) into dev (a1c600b) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev     #122      +/-   ##
==========================================
- Coverage   95.66%   95.62%   -0.04%     
==========================================
  Files          32       33       +1     
  Lines        1637     1691      +54     
==========================================
+ Hits         1566     1617      +51     
- Misses         54       56       +2     
- Partials       17       18       +1     
Impacted Files Coverage Δ
queue/concurrent_array_blocking_queue.go 100.00% <ø> (ø)
queue/concurrent_linked_blocking_queue.go 100.00% <100.00%> (ø)
pool/task_pool.go 98.11% <0.00%> (-0.95%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@kangdan6
Copy link
Contributor Author

kangdan6 commented Nov 24, 2022 via email

queue/concurrent_linked_blocking_queue.go Outdated Show resolved Hide resolved
queue/concurrent_linked_blocking_queue.go Outdated Show resolved Hide resolved
queue/concurrent_linked_blocking_queue_test.go Outdated Show resolved Hide resolved
queue/concurrent_linked_blocking_queue_test.go Outdated Show resolved Hide resolved
queue/concurrent_linked_blocking_queue_test.go Outdated Show resolved Hide resolved
queue/concurrent_linked_blocking_queue.go Outdated Show resolved Hide resolved
queue/concurrent_linked_blocking_queue.go Outdated Show resolved Hide resolved
@flycash
Copy link
Contributor

flycash commented Nov 24, 2022

把删掉的测试还原回来。然后记得执行一下 make setup,这个命令会帮你初始化好一些工具。
同时把这个合并请求加进去 .CHANGELOG 这个文件里面。
执行 make check,它会格式化代码。

}

// NewConcurrentLinkBlockingQueue 创建链式阻塞队列 capacity <= 0 时,为无界队列
// 容量会在最开始的时候就初始化好
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你这个没有容量初始化的问题……在 Array 那里我是指内存一开始就分配好,链表的话是没这个烦恼的

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

所以删了这句话

@flycash
Copy link
Contributor

flycash commented Nov 28, 2022

image

看起来那个十万 Goroutine 的测试跑不了,CI 资源有限,删了吧。或者你改成十个 goroutine 每个写入 1000 个差不多了。

另外点进去 DeepSource:Go 这个action,点进去 Details 看看,修复一下问题。应该只是在

// ConcurrentLinkBlockingQueue 基于链表的并发阻塞队列

这样就可以了

@flycash flycash merged commit b91ed6f into ecodeclub:dev Nov 28, 2022
@flycash flycash linked an issue Dec 6, 2022 that may be closed by this pull request
flycash added a commit that referenced this pull request Dec 6, 2022
* sqlx 加密列 key长度校验 (#102)

* sqlx 加密列 key长度校验

* sqlx 加密列 key长度校验 补单元测试

* 修改加密列key长度错误提示

* atomicx: 泛型封装 atomic.Value (#101)

* atomicx: 泛型封装 atomic.Value

* 添加 CHANGELOG

* syncx/atomicx: 增加 Swap 和 CAS 的泛型包装

* 添加 swap nil 的测试

* 添加更加多的 benchmark 测试,同时保证 NewValue 和 NewValueOf 的语义在 nil 上一致

* 优化单元测试

* queue: API 定义 (#109)

* queue: API 定义

* 补充 API 说明

* 实现优先级队列和并发安全优先级队列 (#110)

基于小顶堆和切片的实现

* queue: 延时队列 (#115)

* 延迟队列: 优化唤醒入队元素逻辑 (#117)

* 修改CHANGELOG链接;添加测试用例修复bug

Signed-off-by: longyue0521 <longyueli0521@gmail.com>

* 修改cond的SignalCh为signalCh;理清注释

Signed-off-by: longyue0521 <longyueli0521@gmail.com>

Signed-off-by: longyue0521 <longyueli0521@gmail.com>

* value: AnyValue 设计 (#120) (#121)

* value: AnyValue 设计 (#120)

* 修复ci检测问题

* 1.fix cr问题
2.add changelog对该pr的引用
3.add license 头部

* 1.修改ChangeLog,加入新特性描述
2.挪出value包,放在根目录
3.统一error格式打印

* 断言方式.Name改为.String

Co-authored-by: vividwei <vividwei@tencent.com>

* queue: 基于切片的并发阻塞队列和基于 CAS 的并发队列设计 (#119)

* queue:使用list包中的LinkedList实现并发阻塞链式队列 (#122)

* queue:增加链式并发阻塞队列

Co-authored-by: kangdan <ujn_kangdan@qq.com>
Co-authored-by: dan.kang <dan.kang@realai.ai>

* ConcurrentLinkBlockingQueue 改成ConcurrentLinkedBlockingQueue (#123)



* ConcurrentLinkBlockingQueue 改成ConcurrentLinkedBlockingQueue

* modify .CHANGELOG.md

* modify .CHANGELOG.md

Co-authored-by: kangdan <ujn_kangdan@qq.com>
Co-authored-by: dan.kang <dan.kang@realai.ai>

* queue: ConcurrentLinkedQueue增加超时控制逻辑 (#124)



Co-authored-by: kangdan <ujn_kangdan@qq.com>
Co-authored-by: dan.kang <dan.kang@realai.ai>

* queue: 添加例子

- 添加队列例子
- 去除 ConcurrentLinkedQueue 的超时机制

* queue: 添加例子 (#126)

Signed-off-by: longyue0521 <longyueli0521@gmail.com>
Co-authored-by: hookokoko <648646891@qq.com>
Co-authored-by: Gevin <flyhigher139@gmail.com>
Co-authored-by: Longyue Li <longyueli0521@gmail.com>
Co-authored-by: 韦佳栋 <353470469@qq.com>
Co-authored-by: vividwei <vividwei@tencent.com>
Co-authored-by: kangdan666 <95063166+kangdan6@users.noreply.github.com>
Co-authored-by: kangdan <ujn_kangdan@qq.com>
Co-authored-by: dan.kang <dan.kang@realai.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

queue: 无界的并发安全队列设计与实现
3 participants