Comments (1)
I suppose you want something like the following?
data TBQueue a
= TBQueue
(TArray a) -- a ring buffer of entries
(TVar Int) -- Index of first queued entry
(TVar Int) -- Index of last queued entry
This sounds plausible to me.
The implementation is likely as it is since no one has tried improving it. Do try writing an array based implementation and benchmark it against the current list-based approach.
from stm.
Related Issues (20)
- Add MArray instance for TArray in IO
- newBroadcastTChan question HOT 1
- documentation for "thread blocked indefinitely in an STM transaction"? HOT 1
- registerDelay not implemented on the non-threaded runtime
- Dependency bounds on Hackage are wrong? HOT 9
- TBQueue haddock docs say "blocks" instead of "retries"
- Why is it blocked? HOT 3
- Huge dependency footprint due to `hashable-1.4.0.0` (via `nats`) HOT 4
- Nonexhaustive pattern in `TBQueue`
- add method to snapshot TBQueue without flushing HOT 3
- MonadFail instance (feature request) HOT 2
- Support size for TBQueue HOT 2
- [stm] : Make it build with ghc-9.8 HOT 1
- Add `waitTSemN`
- Use `Int` for capacity in `TBQueue` interface again?
- CPP macro usage in TArray relies on undefined behavior
- flushTBQueue is broken since 2.5.2.0 HOT 2
- Revert the reimplementation of TBQueue HOT 7
- This repo is broken on case-insensitive systems HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stm.