GithubHelp home page GithubHelp logo

sglbl / cse-344 Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 25.34 MB

Assignments of CSE-344 / System Programming on POSIX using mutexes server client communication, pthreads, parent child communication, semaphores, daemon process, systemV / POSIX / binary semaphores, detached/joinable threads, supplier consumer relationship, pipes

Shell 0.39% C 96.59% Makefile 3.02%
binary-semaphore mutex posix-threads semaphores systemv system5 daemon-process orphans parent-child server-client

cse-344's Introduction

Assignments of CSE-344 / System Programming on POSIX Systems

String replacement with low-level system calls.

Simulating parent-child process relationship. Parent process reads input coordinates from file and forward them for calculations to children processes.

Simulating bakers synchronization problem using named and unnamed semaphores. (inspired by cigarette smokers synchronization problem)

Simulating supplier thread - consumer threads relationship using System V semaphores / semaphore sets.

Using;

  • semget => creating a semaphore set (multiple semaphores)
  • semctl => initializing semaphore set indexes to a number (Using SemUnion)
  • semctl => Checking value of semaphore set index.
  • semop => Incrementing/decrementing the value of semaphore (or multiple semaphores together) using struct sembuf.
  • tprintf=> Variadic function which uses snprintf() and vprintf() to act like a printf with timestamp.
  • detached thread (for supplier) and joinable threads (for clients)

Simulating the usage of POSIX threads to parallelize a couple of mathematical tasks.

Simulating 2 process-pooled servers (Y and Z) executing on the same system as the clients. Which;

  • Y and Z are daemon processes that have no controlling terminal.
  • Y is singleton (measure against double instantiation).
  • Y have p children processes (workers).
  • If children of Y are already busy, they send requests to Z through pipe.
  • Z is a server instantiated by Server Y.
  • Z have children process pool (workers) and delegates requests to its children using shared memory segment.
  • Client connects to server Y through the server fifo (given as a commandline argument), sends its request, receives its response through its client fifo, prints it to STDOUT and exit. (Also it exits gracefully in case of SIGINT)

Simulating a connection system wihch have 3 programs. The servant processes will answer the requests coming from the server through sockets. The client will make requests to the server through sockets, and the server will respond to those requests via the information acquired from the servants. (Using ip address and unique port numbers). It's not fully implemented due to time restrictions.

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.