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` linda_server
`public` linda_client
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:
check_option/1 check_options/1 close_client/1 default_option/1 default_options/1 findall_in_noblock/3 findall_in_noblock/4 findall_rd_noblock/3 findall_rd_noblock/4 in/1 in/2 in_list/2 in_list/3 in_noblock/1 in_noblock/2 linda/0 linda/1 linda_client/1 linda_client/2 linda_timeout/2 option/2 option/3 out/1 out/2 rd/1 rd/2 rd_list/2 rd_list/3 rd_noblock/1 rd_noblock/2 shutdown_server/1 valid_option/1 valid_options/1

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