whirlog
multiversion-concurrency-contro
whirlog | multiversion-concurrency-contro | |
---|---|---|
8 | 16 | |
71 | - | |
- | - | |
1.8 | - | |
over 2 years ago | - | |
Common Lisp | ||
- | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
whirlog
-
The “Build Your Own Database” book is finished
There are many kinds of databases, I've used similar designs to [0] (Lisp warning, ymmv) successfully in several projects.
[0] https://github.com/codr7/whirlog
-
Build Your Own Fast, Persistent, Toy KV Store
I've built several versions of a log based db with composite keys over the years, the most complete version so far in Common Lisp:
https://github.com/codr7/whirlog
- Show HN: Minimal versioned log structured relational DB in Common Lisp
- A minimal single proc, mt capable, versioned, log structured relational Lisp DB
- Show HN: A minimalistic versioned, log-based relational database in Common Lisp
-
Tree.h in OpenBSD: dependency-free intrusive binary tree (2002)
I have a fairly comprehensible left leaning rb tree implementation that I've been porting along my travels.
I keep it around for situations where a binary searched array isn't doable or good enough, but I still want ordered set functionality that isn't in the stdlib.
https://github.com/codr7/whirlog/blob/main/rb.lisp
https://github.com/codr7/libcodr7/blob/master/source/codr7/t...
- Show HN: A simple, log-based relational database in Common Lisp
multiversion-concurrency-contro
-
CRDT-richtext: Rust implementation of Peritext and Fugue
https://github.com/samsquire/multiversion-concurrency-contro...
And I implemented a 3 way text diff with myers algorithm based on https://blog.jcoglan.com/2017/02/12/the-myers-diff-algorithm...
https://github.com/samsquire/text-diff
I implemented an eventually consistent mesh protocol that uses timestamps to provide last write wins
-
A collection of lock-free data structures written in standard C++11
I think I lean towards per-thread sharding instead of mutex based or lock free data structures except for lockfree ringbuffers.
You can get embarassingly parallel performance if you split your data by thread and aggregate periodically.
If you need a consistent view of your entire set of data, that is slow path with sharding.
In my experiments with multithreaded software I simulate a bank where many bankaccounts are randomly withdrawn from and deposited to. https://github.com/samsquire/multiversion-concurrency-contro...
I get 700 million requests per second due to the sharding of money over accounts.
-
The “Build Your Own Database” book is finished
If you want some sample code to implement MVCC, I implemented MVCC in multithreaded Java as a toy example
https://github.com/samsquire/multiversion-concurrency-contro...
First read TransactionC.java then read MVCC.java
-
Let's write a setjmp
I wrote an unrolled switch statement in Java to simulate eager async/await across treads.
https://github.com/samsquire/multiversion-concurrency-contro...
The goal is that a compiler should generate this for you. This code is equivalent to the following:
task1:
-
Structured Concurrency Definition
https://doc.rust-lang.org/book/ch16-00-concurrency.html
I've been working on implementing Java async/await state machine with switch statements and a scheduling loop. If the user doesn't await the async task handle, then the task's returnvalue is never handled. This is similar to the Go problem with the go statement.
https://github.com/samsquire/multiversion-concurrency-contro...
If your async call returns a handle and
-
Small VMs and Coroutines
yield value2++
https://github.com/samsquire/multiversion-concurrency-contro...
I am still working on allowing multiple coroutines to be in flight in parallel at the same time. At the moment the tasks share the same background thread.
I asked this stackoverflow question regarding C++ coroutines, as I wanted to use coroutines with a thread pool.
https://stackoverflow.com/questions/74520133/how-can-i-pass-...
-
Hctree is an experimental high-concurrency database back end for SQLite
This is very interesting. Thank you for submitting this and thank you for working on this.
I am highly interested in parallelism and high concurrency. I implemented multiversion concurrency control in Java.
https://github.com/samsquire/multiversion-concurrency-contro...
I am curious how to handle replication with high concurrency. I'm not sure how you detect dangerous reads+writes to the same key (tuples/fields) across different replica machines. In other words, multiple master.
I am aware Google uses truetime and some form of timestamp ordering and detection of interfering timestamps. But I'm not sure how to replicate that.
I began working on an algorithm to synchronize database records, do a sort, then a hash for each row where hash(row) = hash(previous_row.hash + row.data)
Then do a binary search on hashes matching/not matching. This is a synchronization algorithm I'm designing that requires minimal data transfer but multiple round trips.
The binary search would check the end of the data set for hash(replica_a.row[last]) == hash(replica_b.row[last]) then split the hash list in half and check the middle item, this shall tell you which row and which columns are different.
-
Tail Call Optimization: The Musical
https://github.com/samsquire/multiversion-concurrency-contro...
I want to redesign the architecture of the async/await to be easier to understand. I want to use a state machine somehow.
-
Rust Atomics and Locks: Low-Level Concurrency in Practice
I wrote an unrolled state machine for my async/await in Java. This models a simple async/await program and runs tasks on other threads - without locks. I use a design I call token ring parallelism, where threads take turns and are linked together in a ring structure.
https://github.com/samsquire/multiversion-concurrency-contro...
I wrote a own lock free algorithm here that I use to do message passing between actor threads. My goal is high throughput performance and low latency.
https://github.com/samsquire/multiversion-concurrency-contro...
With 11 threads (on a 12 core processor, deliberately left one core for Windows)
-
A Compiler Writing Playground
I then started writing a parser for a high level language and then code generation from the AST to the imaginary assembly. My interpreter is multithreaded and can send integers between interpreters. It is very early and doesn't do much.
Code is at https://github.com/samsquire/multiversion-concurrency-contro...
The high level language looks similar to Javascript except I tried to parse everything as an expression. I need to parse functions as expressions.
I was experimenting with Protothreads in C recently to try understand how it worked and I wrote a giant switch statement and a while loop in Java to simulate async/await. It would be interesting to do codegen for coroutines.
here's that giant switch statement and scheduler https://github.com/samsquire/multiversion-concurrency-contro...
One idea for a stackless design I had was to preallocate memory for each method call for a call to that function and avoid a stack altogether. This would allow coroutines between methods and avoid the function colour problem because everything is a coroutine.
Is there any communities for programming language developers? Where do all the language developers meet up and talk theory and implementation? I am on eatonphil's discord and we talk there.
One problem I am trying to understand how to solve is how you would write a multithreaded interpreter and language that allowed parallel interpretation similar to C# and Java. If the allocator is thread safe and you share an object pool between interpreters and you hash object equality by sourcecode, then you could send objects between threads with only a synchronization cost.
I believe Python has the problem that object identity is different in each subinterpreter so you need to marshall the data.
What are some alternatives?
illumos-gate - An open-source Unix operating system
electric - Local-first sync layer for web and mobile apps. Build reactive, realtime, local-first apps directly on Postgres.
frr - The FRRouting Protocol Suite
swift - the multiparty transport protocol (aka "TCP with swarming" or "BitTorrent at the transport layer")
quickiebase - a pure-Python NoSQL database
supercollider - An audio server, programming language, and IDE for sound synthesis and algorithmic composition.
barreldb - A disk based KV store (based on Bitcask implementation)
dictomaton - Finite state dictionaries in Java
hamt - A hash array-mapped trie implementation in C
multiversion-concurrency-control - Implementation of multiversion concurrency control, Raft, Left Right concurrency Hashmaps and a multi consumer multi producer Ringbuffer, concurrent and parallel load-balanced loops, parallel actors implementation in Main.java, Actor2.java and a parallel interpreter
pg_crdt - POC CRDT support in Postgres
sync