Skip to content
/ TDC Public

Research on Distributed and concurrent data structures

Notifications You must be signed in to change notification settings

Vamsishark/TDC

Repository files navigation

Concurrent Stack and Distributed Queue Implementations

This repository contains simple implementations of a concurrent stack and a distributed queue in C using POSIX threads (pthread library). The code allows multiple threads to perform stack and queue operations simultaneously while ensuring thread safety through mutex locks.

Contents

Concurrent Stack

Overview

The concurrent stack implementation includes functions to initialize the stack, push elements onto the stack, and pop elements from the stack. Threads are created to perform concurrent push and pop operations.

How to Use

  1. Clone the repository:

Skip this step if you have already did it.

bash
git clone https://github.com/Vamsishark/TDC
  1. Compile the code:

    bash gcc -o concurrent_stack Cyberpunks_concurrent_data_structure.c -lpthread

  2. Run the executable:

    bash ./concurrent_stack

Compilation

The code is compiled using the GCC compiler with the -lpthread flag to link the pthread library.

Example Output

The program prints messages indicating the push and pop operations performed by each thread, along with the associated data.

output for concurrent stack

Distributed Queue

Overview

The distributed queue implementation includes functions to initialize the queue, enqueue elements, and dequeue elements. Threads are created to perform concurrent enqueue and dequeue operations.

How to Use

  1. Clone the repository:

Skip this step if you have already did it.

bash
git clone https://github.com/Vamsishark/TDC
  1. Compile the code:

    bash gcc -o distributed_queue Cyberpunks_distributed_data_structure.c -lpthread

  2. Run the executable:

    bash ./distributed_queue

Compilation

The code is compiled using the GCC compiler with the -lpthread flag to link the pthread library.

Example Output

The program prints messages indicating the enqueue and dequeue operations performed by each thread, along with the associated data.

output for distributed queue

About

Research on Distributed and concurrent data structures

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages