/ConcurrentPartialMarkAndSweep

並行循環参照コレクタ

Primary LanguageC++

Concurrent Partial Mark And Sweep

並行循環参照コレクタ

開発中のプログラミング言語(Catla)で使用(不完全な実装)しているStop The Worldを引き起こさない循環参照コレクタアルゴリズム 1 2

アルゴリズムの詳細はsrc/cycle_collector.cppに記述されている。 実装は動的変異参照カウントの実装に追記したものである。

テストプログラムのビルド方法

ビルドには g++ or clang++, cmake, git が必要です。

  1. https://github.com/google/benchmark のプロジェクトをビルドしてインストールします。 下記の手順は上記サイトの引用です。
# Check out the library.
$ git clone https://github.com/google/benchmark.git
# Go to the library root directory
$ cd benchmark
# Make a build directory to place the build output.
$ cmake -E make_directory "build"
# Generate build system files with cmake, and download any dependencies.
$ cmake -E chdir "build" cmake -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on -DCMAKE_BUILD_TYPE=Release ../
# or, starting with CMake 3.13, use a simpler form:
# cmake -DCMAKE_BUILD_TYPE=Release -S . -B "build"
# Build the library.
$ cmake --build "build" --config Release

# Install
$ sudo cmake --build "build" --config Release --target install
  1. このプロジェクトを clone してビルドします。
# Clone this project.
$ git clone https://github.com/bea4dev/ConcurrentPartialMarkAndSweep.git
# Go to the project root.
$ cd ConcurrentPartialMarkAndSweep
# Build this project.
$ cmake -S . -B build
$ cmake --build build
  1. 実行
$ ./build/dynamic_rc_benchmark

Footnotes

  1. 参考文献 『ガベージコレクション 自動的メモリ管理を構成する理論と実装』

  2. 参考文献 https://pages.cs.wisc.edu/~cymen/misc/interests/Bacon01Concurrent.pdf