Coder Social home page Coder Social logo

kazakosvas / system-programming Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 136 KB

System Programming Project

C 95.67% Makefile 4.33%
c fork pipe select multi-threaded signal-handling socket-programming inter-process-communication producer-consumer thread-synchronization

system-programming's Introduction

System-programming

Project description

This project was created for System-programming class. The project was divided into 3 tasks.

In the 1st task, I implemented a set of data structures (Hash tables, red-black trees) to answer queries in a large dataset of records. The dataset is about monitoring the statistics of hospitals.

In the 2nd task, I implemented a distributed multi-process system that answers queries about viruses and diseases. A parent process is creating worker processes that handle the questions. The parent forwards the questions and receives answers through pipes and select syscall. Finally, I do some signal handling when having functions like read, write and select that may fail when a signal is caught.

In the 3rd task, I implemented:

  1. A multi-threaded client, in which each thread sends a request to the server.

  2. A multi-threaded server, in which each thread plays the role of consumer or producer. Producer thread accepts requests over the network and places them in a "circular" buffer. Consumer threads wait for a request to be accepted and then forward the request to a backend system over the network and send the answer back to the Client. Also, the server does signal handling in a multi-threaded context.

  3. A multi-process backend system was created in the second task but it was updated to answer requests over the network.

Complile & Execute

In the first directory:

  • Compile all programs: make

  • Execute:

bill@LAPTOP-V9A2M01E:/Github/System-programming$ ./backend_system 123
bind: Permission denied
Port 123 was not available. System gave you port 38371
bill@LAPTOP-V9A2M01E:/Github/System-programming$ ./server -SP 1999 -system--name LAPTOP-V9A2M01E -system--port 43609
bill@LAPTOP-V9A2M01E:/Github/System-programming$ ./client -SP 1999 -server--name LAPTOP-V9A2M01E -file--questions questions/file_questions

system-programming's People

Contributors

kazakosvas avatar

Stargazers

 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.