.. index:: single: linda
.. _linda/0:

.. rst-class:: right

**object**

``linda``
=========

Linda tuple-space implementation for process communication. Provides a server that acts as a shared blackboard where clients can write (``out/1-2``), read (``rd/1-2``), and remove (``in/1-2``) tuples. Uses threaded engines for the server implementation and the sockets library for network communication.

| **Availability:** 
|    ``logtalk_load(linda(loader))``

| **Author:** Paulo Moura
| **Version:** 2:0:0
| **Date:** 2026-03-27

| **Compilation flags:**
|    ``static, context_switching_calls, threaded``


| **Imports:**
|    ``public`` :ref:`linda_server <linda_server/0>`
|    ``public`` :ref:`linda_client <linda_client/0>`

| **Remarks:**

   - Supported backends: SWI-Prolog, Trealla Prolog, and XVM (requires both multi-threading and sockets support).
   - Linda operations: The basic operations are ``out/1-2`` (write tuple), ``in/1-2`` (remove tuple, blocking), ``rd/1-2`` (read tuple, blocking), ``in_noblock/1-2`` (remove tuple, non-blocking), and ``rd_noblock/1-2`` (read tuple, non-blocking).
   - Tuple matching: Tuples are matched using unification.
   - Blocking behavior: The ``in/1-2`` and ``rd/1-2`` predicates block until a matching tuple is available. The ``in_noblock/1-2`` and ``rd_noblock/1-2`` predicates fail immediately if no matching tuple is found.
   - Multiple clients: Multiple clients can connect to the same server. A tuple removed by the ``in/1-2`` or ``in_noblock/1-2`` predicates is only removed for one client.
   - Multiple servers: A client can connect to multiple servers. The first server it connects to, uses by default the ``blackboard`` alias.
   - API compatibility: The API is inspired by the SICStus Prolog Linda library.
   - Network communication: Uses TCP sockets for client-server communication, allowing processes to run on different machines.

| **Inherited public predicates:**
|     :ref:`options_protocol/0::check_option/1`  :ref:`options_protocol/0::check_options/1`  :ref:`linda_client/0::close_client/1`  :ref:`options_protocol/0::default_option/1`  :ref:`options_protocol/0::default_options/1`  :ref:`linda_client/0::findall_in_noblock/3`  :ref:`linda_client/0::findall_in_noblock/4`  :ref:`linda_client/0::findall_rd_noblock/3`  :ref:`linda_client/0::findall_rd_noblock/4`  :ref:`linda_client/0::in/1`  :ref:`linda_client/0::in/2`  :ref:`linda_client/0::in_list/2`  :ref:`linda_client/0::in_list/3`  :ref:`linda_client/0::in_noblock/1`  :ref:`linda_client/0::in_noblock/2`  :ref:`linda_server/0::linda/0`  :ref:`linda_server/0::linda/1`  :ref:`linda_client/0::linda_client/1`  :ref:`linda_client/0::linda_client/2`  :ref:`linda_client/0::linda_timeout/2`  :ref:`options_protocol/0::option/2`  :ref:`options_protocol/0::option/3`  :ref:`linda_client/0::out/1`  :ref:`linda_client/0::out/2`  :ref:`linda_client/0::rd/1`  :ref:`linda_client/0::rd/2`  :ref:`linda_client/0::rd_list/2`  :ref:`linda_client/0::rd_list/3`  :ref:`linda_client/0::rd_noblock/1`  :ref:`linda_client/0::rd_noblock/2`  :ref:`linda_client/0::shutdown_server/1`  :ref:`options_protocol/0::valid_option/1`  :ref:`options_protocol/0::valid_options/1`  

.. contents::
   :local:
   :backlinks: top

Public predicates
-----------------

(no local declarations; see entity ancestors if any)

Protected predicates
--------------------

(no local declarations; see entity ancestors if any)

Private predicates
------------------

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

