GithubHelp home page GithubHelp logo

aeri / boreas Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 2.0 348 KB

A cute Linda implementation in C++

License: GNU General Public License v3.0

C++ 95.20% Makefile 4.80%
linda coordination tuples parallel-computing parallel-programming distributed-computing distributed-processing cute

boreas's Introduction

Logo

Boreas

A cute Linda implementation in C++
Getting Started · Deployment

The project

An implementation in C++ of coordination language Linda in a distributed way, to be used in programming concurrent and distributed systems.

How it works?

The objective of the project is to carry out a distributed implementation of the Linda coordination system. The system provides the operations: PN (post note), RN (remove note) and RD/RX (read note). For simplicity, the tuples will be flat, that is to say, there are no tuples where one of their elements is another tuple (nested tuples), they will have a maximum length of 6 elements and all the elements will be of string type.

  • PN (out): Produces a tuple, writing it into tuplespace.
  • RN (in): Atomically reads and removes (consumes) a tuple from tuplespace.
  • RD (rd): Non-destructively reads a tuplespace.
  • RX: Non-destructively reads a tuplespace without blocking.

Wildcards can be used for tuple components in RN and RD/RX operations. For simplicity, a wildcard variable will be indicated by a string composed of "?" and a capital letter between "A" and "Z".

Linda space system

The figure shows an abstraction of the developed system. The Linda server publishes the interface of the distributed coordination system. This interface offers the remote processes five operations: connect to and disconnect from the service, in addition to the three tuple manipulation operations (PN, RN and RD/RX). A C++ process will use the Linda driver library, which is implemented as part of the solution, to invoke these operations remotely.

On the other hand, the Linda server consists of three servers, possibly running on different machines, responsible for storing and managing the operations involving the tuples they store. Specifically, the first server will work with size 1 to 3 tuples, the second with size 4 and 5, while the third will be responsible for size 6 tuples. Internally, the tuples will be stored in memory.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

  • To compile the Linda system environment you need an operating system that supports POSIX Threads. Unix-like POSIX-conformant operating systems such as GNU/Linux, FreeBSD, NetBSD, OpenBSD, macOS...

  • Make (build automation tool)

  • gcc version >= 4.8.5 with POSIX thread model

Compiling

To compile the system it is only necessary to execute the Make command inside the src folder.

$> make

And all files will be compiled consecutively and automatically:

g++ -c -I. -ISocket -O2 -std=c++11 -lsockets -Wall LindaDriver.cpp
g++ -c -I. -ISocket -O2 -std=c++11 -lsockets -Wall tuplas.cpp -o tuplas.o
g++ -c -I. -ISocket -O2 -std=c++11 -lsockets -Wall Socket/Socket.cpp -o Socket/Socket.o
g++ -c -I. -ISocket -O2 -std=c++11 -lsockets -Wall example.cpp
........

Windows Support

Currently, support for Windows systems is limited and only the driver is available to act as a client, therefore it is necessary that the server structure is deployed on Unix-like systems. The driver allows to perform all the operations available by the server, however this driver has not been fully tested and may present some operational problems.

The driver needs to be linked with the -lws2_32 option if MinGW is used.

Deployment

Servers

The deployment is made in different levels since the system is modular and can be executed in different machines.

  • Storage Server: The servers that will store the tuples in memory. Exactly three servers must be run for each deployment; if they are on the same machine, different ports must be used.
./servei <Port_LS>

<Port_LS>: Storage Server port

  • Linda Server: The core of this system, the intermediary between clients and distributed tuples storage systems.
./lindaServer <Port_LS> <IP_S1> <Port_S1> <IP_S2> <Port_S2> <IP_S3> <Port_S3>

<Port_LS>: Linda server port

<IP_S1>: Storage Server IP 1

<Port_S1>: Storage Server port 1

<IP_S2>: Storage Server IP 2

<Port_S2>: Storage Server port 2

<IP_S3>: Storage Server IP 3

<Port_S3>: Storage Server port 3

Clients

The clients are the ones who will service the Linda coordination service through the Linda Server.

  • Interactive Client: This is a keyboard playable client that allows you to use the system interactively through a guided sequence of steps.
./clienteInteractivo <IP_LS> <Port_LS>

<IP_LS>: Linda server IP

<Port_LS>: server port Linda

  • Mixed Client: Semi-atuomatic client, asks the user by keyboard a command and randomly selects an operation PN, RD or RN and generates a tuple to work with. The process is repeated indefinitely.
./clienteMixto <IP_LS> <Port_LS>

<IP_LS>: Linda server IP

<Port_LS>: server port Linda

  • Bruteforce: Automatically upload tuples to tuple servers for stress, memory and access time testing.
./bruteforce <IP_LS> <Port_LS>

<IP_LS>: Linda server IP

<Port_LS>: server port Linda

Authors

See the list of contributors who participated in this project.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details

boreas's People

Contributors

aeri avatar josman231 avatar oumist avatar zgzinfinity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.