Abstract
Logtalk, an object oriented logic programming language, provides experimental support for multi-threading programming with selected back-end Prolog compilers. By making use of core, low-level Prolog predicates that interface with operating-system native threads, Logtalk provides a high-level set of directives and predicates that allows programmers to easily take advantage of modern multi-processor and multi-core computers without worrying about the details of creating, synchronizing, or communicating with threads. Logtalk multi-threading programming features include support for concurrent calls akin to and-parallelism and or-parallelism, non-deterministic thread goals, asynchronous calls, and predicate synchronization. The integration with the Logtalk object-oriented features allows objects to send and receive both synchronous and asynchronous messages and to call local predicates concurrently. Logtalk multi-threading features are orthogonal to object-oriented concepts and can be useful even in the context of plain Prolog.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
ISO/IEC. International Standard ISO/IEC 9945-1:1996. Information Technology–Portable Operating System Interface (POSIX)–Part 1: System Application: Program Interface (API). ISO/IEC (1996)
Butenhof, D.R.: Programming with POSIX Threads. Professional Computing Series. Addison-Wesley, Reading (1997)
Chandra, R., Dagum, L., Kohr, D., Maydan, D., McDonald, J., Menon, R.: Parallel Programming in OpenMP. Morgan Kaufmann Publishers, Los Altos, CA 94022, USA (2001)
OpenMP: Simple, Portable, Scalable SMP Programming, http://openmp.org/
Intel Threading Building Blocks, http://threadingbuildingblocks.org/
Gupta, G., Pontelli, E., Ali, K., Carlsson, M., Hermenegildo, M.: Parallel Execution of Prolog Programs: A Survey. ACM Transactions on Programming Languages and Systems 23(4), 472602 (2001)
Costa, V.S., Warren, D.H.D., Yang, R.: Andorra-I: A Parallel Prolog System that Transparently Exploits both And- and Or-Parallelism. SIGPLAN Not. 26(7), 83–93 (1991)
Ali, K., Karlsson, R.: The Muse Or-parallel Prolog model and its performance. In: Proceedings of the 1990 North American conference on Logic programming, pp. 757–776. MIT Press, Cambridge (1990)
Moura, P.: Logtalk – Design of an Object-Oriented Logic Programming Language. PhD thesis, Department of Computer Science, University of Beira Interior, Portugal (September 2003)
Moura, P.: Logtalk web site, http://logtalk.org/
Moura, P., Marchetti, V.: Logtalk Processing of STEP Part 21 Files. In: Etalle, S., Truszczyński, M. (eds.) ICLP 2006. LNCS, vol. 4079, pp. 453–454. Springer, Heidelberg (2006)
Wielemaker, J.: Native preemptive threads in SWI-Prolog. In: Palamidessi, C. (ed.) ICLP 2003. LNCS, vol. 2916, pp. 331–345. Springer, Heidelberg (2003)
Costa, V.S.: YAP Home Page, http://www.ncc.up.pt/~vsc/Yap/
Clark, K.L., Robinson, P., Hagen, R.: Multi-threading and Message Communication in Qu-Prolog. Theory and Practice of Logic Programming 1(3), 283–301 (2001)
Robinson, P.: Qu-prolog web site, http://www.itee.uq.edu.au/~pjr/HomePages/QuPrologHome.html
Tarau, P.: BinProlog 2006 11.x Professional Edition – Advanced BinProlog Programming and Extensions Guide (2006)
Tarau, P.: BinNet Corporation. BinProlog Home Page, http://www.binnetcorp.com/BinProlog/
The XSB Research Group. The XSB Programmer’s Manual: version 3.1 (2007)
The XSB Research Group. XSB Home Page, http://xsb.sourceforge.net/
Carro, M., Hermenegildo, M.: Concurrency in Prolog Using Threads and a Shared Database. In: International Conference on Logic Programming, pp. 320–334 (1999)
Moura, P.(ed.): ISO/IEC DTR 132115:2007 Prolog Multi-threading predicates, http://logtalk.org/plstd/threads.pdf
Hermenegildo, M.V., Rossi, F.: Strict and Nonstrict Independent And-Parallelism in Logic Programs: Correctness, Efficiency, and Compile-Time Conditions. Journal of Logic Programming 22(1), 1–45 (1995)
González, A.: Speculative Threading: Creating New Methods of Thread-Level Parallelization (December 2005), http://www.intel.com/technology/magazine/research/speculative-threading-1205.htm
Wikipedia: Dining philosophers problem, http://en.wikipedia.org/wiki/Dining_philosophers_problem
Eskilson, J., Carlsson, M.: SICStus MT—A Multithreaded Execution Environment for SICStus Prolog. In: Palamidessi, C., Glaser, H., Meinke, K. (eds.) ALP 1998 and PLILP 1998. LNCS, vol. 1490, pp. 36–53. Springer, Heidelberg (1998)
Hedqvist, P.: A Parallel and Multithreaded Erlang Implementation. Master’s thesis, Uppsala University, Uppsala, Sweden (June 1998)
Erlang Home Page, http://www.erlang.org/
Hodgson, J.: ISO/IEC/ JTC1/SC22/WG17 Official Home Page, http://www.sju.edu/~jhodgson/wg17/wg17web.html
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2007 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Moura, P., Crocker, P., Nunes, P. (2007). High-Level Multi-threading Programming in Logtalk. In: Hudak, P., Warren, D.S. (eds) Practical Aspects of Declarative Languages. PADL 2008. Lecture Notes in Computer Science, vol 4902. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-77442-6_18
Download citation
DOI: https://doi.org/10.1007/978-3-540-77442-6_18
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-77441-9
Online ISBN: 978-3-540-77442-6
eBook Packages: Computer ScienceComputer Science (R0)