dplyukhin / UIGC

A garbage collector for Akka actors!
Other
4 stars 2 forks source link

Multiple GC message queues #40

Open dplyukhin opened 10 months ago

dplyukhin commented 10 months ago

The CRGC algorithm I developed is inspired by the MAC algorithm used in the Pony actor language. In MAC and CRGC, all actors periodically send snapshots to the garbage collector; the garbage collector uses the snapshots to identify garbage actors and kill them.

In MAC, the garbage collector has one mailbox. This is a bottleneck when multiple threads attempt to place messages in the mailbox at the same time. This bottleneck can't be removed MAC requires causal message delivery, and the mailbox is needed to enforce that.

CRGC doesn't require causal message delivery. It only requires that messages from each actor arrive in FIFO order. So we could use multiple message queues with consistent hashing instead.

This project involves:

  1. Investigating whether the single message queue is a bottleneck in CRGC.
  2. Implementing consistent hashing message queues in CRGC.
  3. Demonstrating a performance improvement.

First steps: Write a multithreaded program in which threads write to the same ConcurrentLinkedQueue. Then write another program in which threads use consistent hashing to write into different queues. Compare the performance.