Skip to main content
Top
Published in: International Journal of Parallel Programming 3/2016

01-06-2016

A Lock-Free Hash Trie Design for Concurrent Tabled Logic Programs

Authors: Miguel Areias, Ricardo Rocha

Published in: International Journal of Parallel Programming | Issue 3/2016

Log in

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Tabling is an implementation technique that improves the declarativeness and expressiveness of Prolog systems in dealing with recursion and redundant sub-computations. A critical component in the design of a concurrent tabling system is the implementation of the table space. One of the most successful proposals for representing tables is based on a two-level trie data structure, where one trie level stores the tabled subgoal calls and the other stores the computed answers. In previous work, we have presented a sophisticated lock-free design where both levels of the tries where shared among threads in a concurrent environment. To implement lock-freedom we used the CAS atomic instruction that nowadays is widely found on many common architectures. CAS reduces the granularity of the synchronization when threads access concurrent areas, but still suffers from problems such as false sharing or cache memory effects. In this work, we present a simpler and efficient lock-free design based on hash tries that minimizes these problems by dispersing the concurrent areas as much as possible. Experimental results in the Yap Prolog system show that our new lock-free design can effectively reduce the execution time and scales better than previous designs.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Footnotes
1
In general, a tabled program is deterministic, finite and only executes search and insert operations over the table space data structures. In Yap Prolog, space is recovered when the last running thread abolishes a table. Since no delete operations are performed, the size of the tables always grows monotonically during an evaluation.
 
3
We have experimented with multiple configurations for the separate chaining and hash levels. Our best results were obtained with four nodes for the separate chaining and 8 entries for the hash levels, which are the current default values for the experiments that follow.
 
4
Due to the lack of space, we are not including mixed insert/lookup benchmarks. Yet, we have experimented with a lot of mixed scenarios and we have verified that the results obtained are within the bounds of the results shown next for the insert(N) and lookup(N) benchmarks.
 
5
Note that we have separate implementations for Yap and for JDK.
 
Literature
1.
go back to reference Areias, M., Rocha, R.: An efficient and scalable memory allocator for multithreaded tabled evaluation of logic programs. In: International Conference on Parallel and Distributed Systems, pp. 636–643. IEEE Computer Society (2012) Areias, M., Rocha, R.: An efficient and scalable memory allocator for multithreaded tabled evaluation of logic programs. In: International Conference on Parallel and Distributed Systems, pp. 636–643. IEEE Computer Society (2012)
2.
go back to reference Areias, M., Rocha, R.: Towards multi-threaded local tabling using a common table space. J. Theory Pract. Logic Program. 12(4 & 5), 427–443 (2012)CrossRefMATH Areias, M., Rocha, R.: Towards multi-threaded local tabling using a common table space. J. Theory Pract. Logic Program. 12(4 & 5), 427–443 (2012)CrossRefMATH
3.
go back to reference Areias, M., Rocha, R.: On the correctness and efficiency of lock-free expandable tries for tabled logic programs. In: International Symposium on Practical Aspects of Declarative Languages, no. 8324 in LNCS, pp. 168–183. Springer (2014) Areias, M., Rocha, R.: On the correctness and efficiency of lock-free expandable tries for tabled logic programs. In: International Symposium on Practical Aspects of Declarative Languages, no. 8324 in LNCS, pp. 168–183. Springer (2014)
4.
go back to reference Bagwell, P.: Ideal hash trees. Es Grands Champs 1195 (2001) Bagwell, P.: Ideal hash trees. Es Grands Champs 1195 (2001)
6.
go back to reference Dawson, S., Ramakrishnan, C.R., Warren, D.S.: Practical program analysis using general purpose logic programming systems—a case study. In: ACM Conference on Programming Language Design and Implementation, pp. 117–126. ACM (1996) Dawson, S., Ramakrishnan, C.R., Warren, D.S.: Practical program analysis using general purpose logic programming systems—a case study. In: ACM Conference on Programming Language Design and Implementation, pp. 117–126. ACM (1996)
8.
go back to reference Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann, Burlington (2008) Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann, Burlington (2008)
9.
go back to reference Herlihy, M., Wing, J.M.: Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst. 12(3), 463–492 (1990)CrossRef Herlihy, M., Wing, J.M.: Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst. 12(3), 463–492 (1990)CrossRef
10.
go back to reference Johnson, M.: Memoization in top-down parsing. Comput. Linguist. 21(3), 405–417 (1995) Johnson, M.: Memoization in top-down parsing. Comput. Linguist. 21(3), 405–417 (1995)
11.
go back to reference Marques, R., Swift, T.: Concurrent and local evaluation of normal programs. In: International Conference on Logic Programming, no. 5366 in LNCS, pp. 206–222. Springer (2008) Marques, R., Swift, T.: Concurrent and local evaluation of normal programs. In: International Conference on Logic Programming, no. 5366 in LNCS, pp. 206–222. Springer (2008)
12.
go back to reference Marques, R., Swift, T., Cunha, J.C.: A Simple and efficient implementation of concurrent local tabling. In: International Symposium on Practical Aspects of Declarative Languages, no. 5937 in LNCS, pp. 264–278. Springer (2010) Marques, R., Swift, T., Cunha, J.C.: A Simple and efficient implementation of concurrent local tabling. In: International Symposium on Practical Aspects of Declarative Languages, no. 5937 in LNCS, pp. 264–278. Springer (2010)
14.
go back to reference Prokopec, A., Bronson, N.G., Bagwell, P., Odersky, M.: Concurrent tries with efficient non-blocking snapshots. In: ACM Symposium on Principles and Practice of Parallel Programming, pp. 151–160. ACM (2012) Prokopec, A., Bronson, N.G., Bagwell, P., Odersky, M.: Concurrent tries with efficient non-blocking snapshots. In: ACM Symposium on Principles and Practice of Parallel Programming, pp. 151–160. ACM (2012)
15.
go back to reference Ramakrishna, Y.S., Ramakrishnan, C.R., Ramakrishnan, I.V., Smolka, S.A., Swift, T., Warren, D.S.: Efficient model checking using tabled resolution. In: Computer Aided Verification, no. 1254 in LNCS, pp. 143–154. Springer (1997) Ramakrishna, Y.S., Ramakrishnan, C.R., Ramakrishnan, I.V., Smolka, S.A., Swift, T., Warren, D.S.: Efficient model checking using tabled resolution. In: Computer Aided Verification, no. 1254 in LNCS, pp. 143–154. Springer (1997)
16.
go back to reference Rocha, R., Silva, F., Santos Costa, V.: On applying or-parallelism and tabling to logic programs. Theory Pract. Log. Program. 5(1 & 2), 161–205 (2005)MathSciNetCrossRefMATH Rocha, R., Silva, F., Santos Costa, V.: On applying or-parallelism and tabling to logic programs. Theory Pract. Log. Program. 5(1 & 2), 161–205 (2005)MathSciNetCrossRefMATH
17.
go back to reference Sagonas, K., Swift, T., Warren, D.S.: XSB as an efficient deductive database engine. In: ACM International Conference on the Management of Data, pp. 442–453. ACM (1994) Sagonas, K., Swift, T., Warren, D.S.: XSB as an efficient deductive database engine. In: ACM International Conference on the Management of Data, pp. 442–453. ACM (1994)
20.
go back to reference Triplett, J., McKenney, P.E., Walpole, J.: Resizable, scalable, concurrent hash tables via relativistic programming. In: USENIX Annual Technical Conference, p. 11. USENIX Association (2011) Triplett, J., McKenney, P.E., Walpole, J.: Resizable, scalable, concurrent hash tables via relativistic programming. In: USENIX Annual Technical Conference, p. 11. USENIX Association (2011)
21.
go back to reference Zou, Y., Finin, T.W., Chen, H.: F-OWL: An inference engine for semantic web. In: International Workshop on Formal Approaches to Agent-Based Systems, LNCS, vol. 3228, pp. 238–248. Springer (2004) Zou, Y., Finin, T.W., Chen, H.: F-OWL: An inference engine for semantic web. In: International Workshop on Formal Approaches to Agent-Based Systems, LNCS, vol. 3228, pp. 238–248. Springer (2004)
Metadata
Title
A Lock-Free Hash Trie Design for Concurrent Tabled Logic Programs
Authors
Miguel Areias
Ricardo Rocha
Publication date
01-06-2016
Publisher
Springer US
Published in
International Journal of Parallel Programming / Issue 3/2016
Print ISSN: 0885-7458
Electronic ISSN: 1573-7640
DOI
https://doi.org/10.1007/s10766-014-0346-1

Other articles of this Issue 3/2016

International Journal of Parallel Programming 3/2016 Go to the issue

Premium Partner