GithubHelp home page GithubHelp logo

bois-barganhados-studio / nanvix-user-level-thread Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nanvix/nanvix

4.0 0.0 0.0 6.79 MB

A user-level thread library implementation for the Nanvix Educational OS.

Home Page: https://github.com/nanvix

License: GNU General Public License v3.0

Shell 1.89% C 93.61% Assembly 2.67% Makefile 1.75% Smarty 0.04% GDB 0.04%
educational-project multithreading operating-systems parallel-programming

nanvix-user-level-thread's Introduction

Bthread - A basic user-level thread library for Nanvix

The Bthread library was created for the Interdisciplinary Project V subject of the computer science course at PUC Minas with educational purposes in mind, such as, helping students understand how concurrent programs work as well as providing ways for the developing of concurrent programming practices.

About Bthread

Features

The Bthread library implements a preemptive aproach with round-robin and provides the following features: Thread creation and termination

  • Thread joining and detaching
  • Thread cancellation
  • Thread yield
  • Mutexes

API

The Bthread library API is composed of the following functions:

int bthread_create(bthread_t *thread, void *(*start_routine)(), void *arg);
int bthread_join(bthread_t thread, void **thread_return);
int bthread_detach(bthread_t thread);
void bthread_yield(void);
bthread_t bthread_self(void);
int bthread_cancel(bthread_t thread);
struct bt_mutex *bthread_mutex_init(void);
int bthread_mutex_lock(struct bt_mutex *mutex);
int bthread_mutex_unlock(struct bt_mutex *mutex);
int bthread_mutex_destroy(struct bt_mutex *mutex);

For more information about the Bthread library API, please refer to the bthread.h header file.

Usage

To use the Bthread library in a Nanvix program, the following steps must be taken:

  1. Setup the Nanvix development environment as described at setup.md.
  2. Create a new user program in the src/ubin directory.
  3. Include the bthread.h header file in the user program.
  4. Build Nanvix as described at build.md.
  5. Run Nanvix using your choosen system simulator (QEMU is recommended).

Example

A simple example of the Bthread library usage is available in the user program bthd in Nanvix, its source code is available at src/ubin/bthd/bthd.c.

About Nanvix

What Is Nanvix?

Nanvix is a Unix-like operating system written by Pedro Henrique Penna for educational purposes. It is designed to be simple and small, but also modern and fully featured.

What Hardware Is Required to Run Nanvix?

Nanvix targets 32-bit x86-based PCs and only requires a floppy or CD-ROM drive and 16 MB of RAM. You can run it either in a real PC or in a virtual machine, using a system image.

License and Maintainers

Nanvix is a free software that is under the GPL V3 license and is maintained by Pedro Henrique Penna. Any questions or suggestions send him an email: [email protected]

BThread

BThread is also under the GPL V3 license and was made by:

nanvix-user-level-thread's People

Contributors

ppenna avatar fjorgemota avatar ravixr avatar theldus avatar mbcastro avatar rurtle avatar turbolay avatar rogerrubens avatar tarberd avatar ramaddict avatar pedropampolini avatar alekfrohlich avatar bernardogo avatar gustavomoser avatar stanleysathler avatar guilhermewerner avatar eduhenke avatar fbroqued avatar

Stargazers

Edmar Melandes avatar  avatar  avatar Leon Júnio Martins Ferreira 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.