Hostname: page-component-6766d58669-r8qmj Total loading time: 0 Render date: 2026-05-24T06:27:49.745Z Has data issue: false hasContentIssue false

Lock-free atom garbage collection for multithreaded Prolog

Published online by Cambridge University Press:  14 October 2016

JAN WIELEMAKER
Affiliation:
VU University Amsterdam, The Netherlands CWI Amsterdam, The Netherlands (e-mail: J.Wielemaker@vu.nl)
KERI HARRIS
Affiliation:
SecuritEase, New Zealand (e-mail: keri@gentoo.org)

Abstract

The runtime system of dynamic languages such as Prolog or Lisp and their derivatives contain a symbol table, in Prolog often called the atom table. A simple dynamically resizing hash-table used to be an adequate way to implement this table. As Prolog becomes fashionable for 24 × 7 server processes we need to deal with atom garbage collection and concurrent access to the atom table. Classical lock-based implementations to ensure consistency of the atom table scale poorly and a stop-the-world approach to implement atom garbage collection quickly becomes a bottle-neck, making Prolog unsuitable for soft real-time applications. In this article we describe a novel implementation for the atom table using lock-free techniques where the atom-table remains accessible even during atom garbage collection. Relying only on CAS (Compare And Swap) and not on external libraries, the implementation is straightforward and portable.

Information

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2016 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Article purchase

Temporarily unavailable