Git Product home page Git Product logo

cthread's Introduction


CthreAd

A multi-threading library for C Programs

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Usage
  3. Testing
  4. Contributing
  5. Acknowledgements
  6. Authors

About The Project

CthreAd is a multi-threading library which implements POSIX compliant threads in the Linux userland. Primarily, we have implemented two models of multi-threading:

  • One-One

    One-One model of multi-threading maps each user-level thread with a kernel-level thread. All the threads can access the kernel at the same time. Even if a thread makes a blocking system call (i/o, etc.), other threads can continue to run.

    one-one

  • Many-One

    The many to one model maps many of the user threads to a single kernel thread. This model is quite efficient as the user space manages the thread management. The library performs the context-switch and scheduling operations.

    many-one

Usage

To use CthreAd in your projects:

  • Clone the repository using
    $ git clone https://gitlab.com/andipro123/cthread.git
  • Move to the directory and choose the model you want to implement
    # for one-one
    $ cd cthread/one-one
    
    # for many-one
    $ cd cthread/many-one
  • Compile the library
    $ gcc cthread.c -c -Wall
    
    #for many-one, use "cthread2.c"
  • Include the header file in your project
    // Your C program
    
    #include<cthread.h>
    .
    .
    .
  • Compile your project using
    $ gcc <your-project.c> cthread.o - o <your-project>
    
    #for many-one, use "cthread2.o"

Testing

The library comes with an automatic testing package to test all the functionalities of the threading library. Tests cover all areas of multi-threading to ensure that basic functions are working as expected. To run the tests:

$ make run

Contributing

This library is not a production level multi-threading library yet. Please use caution while using it in your production softwares. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

References

Authors

cthread's People

Contributors

andipro123 avatar chetasborse 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.