Skip to main content Accessibility help
×
Home

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)
Corresponding

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.

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.

References

Boehm, H.-J. 1993. Space efficient conservative garbage collection. In Proceedings of the ACM SIGPLAN 1993 Conference on Programming Language Design and Implementation, PLDI '93. ACM, New York, NY, USA, 197206.CrossRefGoogle Scholar
Creutz, M. 2003. Unsupervised segmentation of words using prior distributions of morph length and frequency. In Proceedings of the 41st Annual Meeting on Association for Computational Linguistics - Volume 1, ACL '03. Association for Computational Linguistics, Stroudsburg, PA, USA, 280287.Google Scholar
Desnoyers, M., McKenney, P. E., Stern, A. S., Dagenais, M. R. and Walpole, J. 2012. User-level implementations of read-copy update. IEEE Transactions on Parallel and Distributed Systems 23, 2, 375382.CrossRefGoogle Scholar
Harris, T., Marlow, S., Jones, S. L. P. and Herlihy, M. 2008. Composable memory transactions. Commun. ACM 51, 8, 91100.CrossRefGoogle Scholar
Klyne, G. and Carroll, J. J. 2004. Resource description framework (RDF): Concepts and abstract syntax. World Wide Web Consortium, Recommendation REC-rdf-concepts-20040210.Google Scholar
Lindgren, T. 2005. Atom garbage collection. In Proceedings of the 2005 ACM SIGPLAN Workshop on Erlang, ERLANG '05. ACM, New York, NY, USA, 4045.CrossRefGoogle Scholar
Michael, M. M. 2004. Hazard pointers: safe memory reclamation for lock-free objects. IEEE Transactions on Parallel and Distributed Systems 15, 6 (June), 491504.CrossRefGoogle Scholar
Tarau, P. 2011. Integrated symbol table, engine and heap memory management in multi-engine Prolog. In Proceedings of the International Symposium on Memory Management. ISMM '11. ACM, New York, NY, USA, 129138.Google Scholar
Triplett, J., McKenney, P. E. and Walpole, J. 2011. Resizable, scalable, concurrent hash tables via relativistic programming. In 2011 USENIX Annual Technical Conference, Portland, OR, USA, June 15-17, 2011, Nieh, J. and Waldspurger, C. A., Eds. USENIX Association.Google Scholar
Wielemaker, J. 2003. Native preemptive threads in SWI-Prolog. In Logic Programming, 19th International Conference, ICLP 2003, Mumbai, India, December 9–13, 2003, Proceedings, Palamidessi, C., Ed. Lecture Notes in Computer Science, vol. 2916. Springer, 331345.Google Scholar

Full text views

Full text views reflects PDF downloads, PDFs sent to Google Drive, Dropbox and Kindle and HTML full text views.

Total number of HTML views: 0
Total number of PDF views: 102 *
View data table for this chart

* Views captured on Cambridge Core between 14th October 2016 - 26th January 2021. This data will be updated every 24 hours.

Linked content

Please note a has been issued for this article.

Hostname: page-component-898fc554b-wphb9 Total loading time: 0.735 Render date: 2021-01-26T07:19:58.956Z Query parameters: { "hasAccess": "0", "openAccess": "0", "isLogged": "0", "lang": "en" } Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "metricsAbstractViews": false, "figures": false, "newCiteModal": false }

Send article to Kindle

To send this article to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about sending to your Kindle. Find out more about sending to your Kindle.

Note you can select to send to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be sent to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Lock-free atom garbage collection for multithreaded Prolog
Available formats
×

Send article to Dropbox

To send this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Dropbox.

Lock-free atom garbage collection for multithreaded Prolog
Available formats
×

Send article to Google Drive

To send this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Google Drive.

Lock-free atom garbage collection for multithreaded Prolog
Available formats
×
×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *