https://github.com/welllog/ringbuf
ring queue, support multiple reads and writes,lock free
https://github.com/welllog/ringbuf
lock-free ring-queue
Last synced: over 1 year ago
JSON representation
ring queue, support multiple reads and writes,lock free
- Host: GitHub
- URL: https://github.com/welllog/ringbuf
- Owner: welllog
- License: mit
- Created: 2020-07-19T03:25:19.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-29T09:26:33.000Z (about 3 years ago)
- Last Synced: 2025-01-18T05:42:45.598Z (over 1 year ago)
- Topics: lock-free, ring-queue
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lock-free ring queue
### Usage
```go
queue := NewQueue(8)
ok := queue.Put(1)
val, ok := queue.Get()
```
#### block operate
```go
// block at least 50ms
ok = queue.PutWait(2, time.Second)
val, ok = queue.GetWait(time.Second)
```