Mastodon Feed: Post

Mastodon Feed

dysfun@treehouse.systems ("gaytabase") wrote:

well gosh, people wanted to know.

it's a rather specialist RRB vector for a very particular purpose.

you may recall that i was using 'lowest active transaction' to bound reclamation of unused data. in a single writer CoW system with immutable data, this is all you need. however, it's expensive to synchronise many transactions, so you need to offset this somehow.

my answer was to make each thread register itself and keep track of all of the transactions in use on that thread. it only has to report the low bound to the central synchronisation point.

what do you need for this?

  • an ordered data structure that has the transaction ids as keys (a monotonically incrementing counter)
  • a count attached to each key. a refcount if you like.

the important thing to note is that the thread only has to update the central sync area when the lowest transaction id on the thread changes. i've even put an artificial cap of 64 concurrent readers threads on it currently because that's more than enough for my purposes.

so the entire point of this data structure is really just to help with minimising maintainance required to the central synchronisation area. we'll design it in the next toot.