1873744231719956872, 1870942850684420564, 1738800602568638492
This commit is contained in:
1 parent
ba3674cbd7
commit
a6e6d7616c
15 files changed
+620
No files matched your search
+37
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: "I just do combinations of separate SPSC ring buffers with a known amount of input and output threads."
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/AgileJebrim/status/1873824152013959209"
|
||||
author: "Jebrim"
|
||||
handle: AgileJebrim
|
||||
post_id: "1873824152013959209"
|
||||
date: 2024-12-30
|
||||
archived: 2026-08-26
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- bmcnett
|
||||
description: "I just do combinations of separate SPSC ring buffers with a known amount of input and output threads."
|
||||
in_reply_to: ""
|
||||
parent_post_id: "1873744231719956872"
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/AgileJebrim/status/1873824152013959209
|
||||
- Author: Jebrim (@AgileJebrim)
|
||||
- Posted: 2024-12-30 20:11:06
|
||||
|
||||
## Branch
|
||||
|
||||
**1/** **@AgileJebrim** ^1873824152013959209
|
||||
|
||||
I just do combinations of separate SPSC ring buffers with a known amount of input and output threads. The ratio of producers to consumers dictates how many of each ring buffer each thread gets assigned to it. They just iterate through each per pass.
|
||||
|
||||
Way more predictable execution times when done like this. No spin loops of unknown duration.
|
||||
|
||||
## Related
|
||||
|
||||
- Spine: [[archive/threads/bmcnett/2024-12-30-the-simplest-multi-producer-multi-consumer-ring]]
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
---
|
||||
title: "@bmcnett There is another way, one can group items and just do counting per group, release the whole group only when all items in group are ready"
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/NOTimothyLottes/status/1873749894437187586"
|
||||
author: "NOTimothyLottes"
|
||||
handle: NOTimothyLottes
|
||||
post_id: "1873749894437187586"
|
||||
date: 2024-12-30
|
||||
archived: 2026-08-26
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- bmcnett
|
||||
description: "@bmcnett There is another way, one can group items and just do counting per group, release the whole group only when all items in group are ready"
|
||||
in_reply_to: ""
|
||||
parent_post_id: "1873744231719956872"
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/NOTimothyLottes/status/1873749894437187586
|
||||
- Author: NOTimothyLottes (@NOTimothyLottes)
|
||||
- Posted: 2024-12-30 15:16:02
|
||||
|
||||
## Branch
|
||||
|
||||
**1/** **@NOTimothyLottes** ^1873749894437187586
|
||||
|
||||
**@bmcnett**
|
||||
|
||||
There is another way, one can group items and just do counting per group, release the whole group only when all items in group are ready
|
||||
|
||||
**2/** **@bmcnett** ^1873752260020404449
|
||||
|
||||
**@NOTimothyLottes**
|
||||
|
||||
that's trivial for a multi producer single consumer, how do you do it simply for a multi consumer?
|
||||
|
||||
**3/** **@NOTimothyLottes** ^1873823299819758004
|
||||
|
||||
**@bmcnett**
|
||||
|
||||
Here is an idea how to do it via minimal atomics. 2M max items per frame. Tune group size to machine, and have the producers start ahead enough, and the (lock-free) spins likely won't happen in practice ... (if on GPU then optimize the atomicAdd()'s, etc)
|
||||
|
||||

|
||||
|
||||
**4/** **@bmcnett** ^1873830067270541695
|
||||
|
||||
**@NOTimothyLottes**
|
||||
|
||||
ah, ok i get it now. i don't spin inside API, so user can decide when they want to be wait-free
|
||||
|
||||
**5/** **@NOTimothyLottes** ^1873831867499381145
|
||||
|
||||
**@bmcnett**
|
||||
|
||||
Yeah, exactly that, there are many optimizations possible. Like producers can amortize to one atomic per group to advance ready. Producers could queue the group locally if it isn't active and keep going. Etc.
|
||||
|
||||
## Related
|
||||
|
||||
- Spine: [[archive/threads/bmcnett/2024-12-30-the-simplest-multi-producer-multi-consumer-ring]]
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: "@bmcnett Qubits:"
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/mbur82/status/1873745174435860798"
|
||||
author: "MB82"
|
||||
handle: mbur82
|
||||
post_id: "1873745174435860798"
|
||||
date: 2024-12-30
|
||||
archived: 2026-08-26
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- bmcnett
|
||||
description: "@bmcnett Qubits:"
|
||||
in_reply_to: ""
|
||||
parent_post_id: "1873744231719956872"
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/mbur82/status/1873745174435860798
|
||||
- Author: MB82 (@mbur82)
|
||||
- Posted: 2024-12-30 14:57:16
|
||||
|
||||
## Branch
|
||||
|
||||
**1/** **@mbur82** ^1873745174435860798
|
||||
|
||||
**@bmcnett**
|
||||
|
||||
Qubits:
|
||||
|
||||
<video controls src="https://video.twimg.com/tweet_video/GgDhTaJWYAA9UqB.mp4"></video>
|
||||
|
||||
## Related
|
||||
|
||||
- Spine: [[archive/threads/bmcnett/2024-12-30-the-simplest-multi-producer-multi-consumer-ring]]
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: "The simplest multi-producer-multi-consumer ring buffer data structure would seem to need one \"trit\" (ternary bit) of state per buffer entry, for the states \"awaiting write\", \"awaiting read\", \"busy\""
|
||||
type: archive
|
||||
source: twitter
|
||||
source_url: "https://x.com/bmcnett/status/1873744231719956872"
|
||||
author: "bmcnett"
|
||||
handle: bmcnett
|
||||
post_id: "1873744231719956872"
|
||||
date: 2024-12-30
|
||||
archived: 2026-08-26
|
||||
draft: false
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- bmcnett
|
||||
description: "The simplest multi-producer-multi-consumer ring buffer data structure would seem to need one \"trit\" (ternary bit) of state per buffer entry, for the states \"awaiting write\", \"awaiting read\", \"busy\""
|
||||
in_reply_to: ""
|
||||
---
|
||||
|
||||
## Source
|
||||
|
||||
- URL: https://x.com/bmcnett/status/1873744231719956872
|
||||
- Author: bmcnett (@bmcnett)
|
||||
- Posted: 2024-12-30 14:53:31
|
||||
|
||||
## Thread
|
||||
|
||||
**1/** **@bmcnett** ^1873744231719956872
|
||||
|
||||
The simplest multi-producer-multi-consumer ring buffer data structure would seem to need one "trit" (ternary bit) of state per buffer entry, for the states "awaiting write", "awaiting read", "busy"
|
||||
|
||||
Branches: [[archive/threads/bmcnett/2024-12-30-the-simplest-multi-producer-multi-consumer-ring/2024-12-30-mbur82-qubits]], [[archive/threads/bmcnett/2024-12-30-the-simplest-multi-producer-multi-consumer-ring/2024-12-30-NOTimothyLottes-there-is-another-way-one-can-group-items-and-just]], [[archive/threads/bmcnett/2024-12-30-the-simplest-multi-producer-multi-consumer-ring/2024-12-30-AgileJebrim-i-just-do-combinations-of-separate-spsc-ring]]
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: bmcnett
|
||||
type: note
|
||||
draft: false
|
||||
description: Archived threads by bmcnett.
|
||||
tags:
|
||||
- archive
|
||||
- twitter
|
||||
- bmcnett
|
||||
---
|
||||
|
||||
- [[archive/threads/bmcnett/2024-12-30-the-simplest-multi-producer-multi-consumer-ring]]
|
||||
Reference in new issue
Block a user