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

01.06.2016

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

verfasst von: Miguel Areias, Ricardo Rocha

Erschienen in: International Journal of Parallel Programming | Ausgabe 3/2016

Einloggen

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

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.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

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!

Fußnoten
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.
 
Literatur
1.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat Bagwell, P.: Ideal hash trees. Es Grands Champs 1195 (2001) Bagwell, P.: Ideal hash trees. Es Grands Champs 1195 (2001)
6.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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.
Zurück zum Zitat 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)
18.
20.
Zurück zum Zitat 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.
Zurück zum Zitat 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)
Metadaten
Titel
A Lock-Free Hash Trie Design for Concurrent Tabled Logic Programs
verfasst von
Miguel Areias
Ricardo Rocha
Publikationsdatum
01.06.2016
Verlag
Springer US
Erschienen in
International Journal of Parallel Programming / Ausgabe 3/2016
Print ISSN: 0885-7458
Elektronische ISSN: 1573-7640
DOI
https://doi.org/10.1007/s10766-014-0346-1

Weitere Artikel der Ausgabe 3/2016

International Journal of Parallel Programming 3/2016 Zur Ausgabe

Premium Partner