Code Monkey home page Code Monkey logo

ptask's Introduction

ptask

Periodic Real-Time Task interface to pthreads

  • Version 0.1, April 2013
  • Version 0.2, August 2013
  • Version 0.3, September 2015
  • Version 0.4, July 2017
  • Version 0.5, February 2019

Authors

Contributors

  • Alessio Balsini ([email protected])
  • Alexandre Becart and Benoit Delecroix (integrating SCHED_DEADLINE)
  • Pierre Caruyer (dline exception)
  • Amine El Messaoudi and Flora Dziedzic (ptaskTracer)

License: GPL 3.0


Introduction

PTASK is a simple wrapper to the pthread library. It is intended for real-time programmers that wish to control the timing behaviour and the synchronisation of threads. It is intended to be minimalistic, yet extensible to more complex usage scenarios.

Currently it provides:

  • An API for implementing periodic and aperiodic tasks;
  • A simple API for group scheduling and synchronization;
  • An API for mode changes.

A manual is available in docs/ptask_manual_x.x.pdf.


Instructions

Prerequisites

  • Allegro 4 libraries
  • CMake 3.1+

Compiling

To compile the library the first time, enter the main ptask folder (from now identified with ptask/) and type:

$ mkdir build
$ cd build
$ cmake ..
$ make

this produces the library file ptask/build/src/libptask.a, that must be included into your projects.

This also compiles all the:

  • examples (ptask/build/src/examples);
  • tests (ptask/build/src/tests).

To compile the examples, use the same procedure in directory examples/. Before doing that, make sure you have already installed the Allegro library, version 4 (http://liballeg.org/download.html). On Ubuntu systems, you can install it with

  sudo apt-get install liballegro4-dev

Once you compiled the sources, remember to become super-user, otherwise Linux will not allow you to create real-time tasks!

To run the tests, execute the script

$ ptask/build/src/tests/runtest.sh

or, from the ptask/build/ directory, run

$ sudo make test

Tracing

You can now visualize the execution trace of the tasks in a PTASK application using ptaskTracer, a library build on top of ltt-ng. ptaskTracer uses ltt-ng to produce an event file, that is then parsed by a Java tool and transformed into a SVG file that can be visualized in any browser.

To use ptaskTracer, you must first install the lttng development library (in Debian, package liblttng-ust-dev), then invoke cmake with option -DTRACE=ON.

Happy programming!

ptask's People

Contributors

abxu avatar balsini avatar floradziedzic avatar glipari avatar mtango avatar pierrecaruyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ptask's Issues

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

I have an issue during the folder making :

After executing the cmake command I got this output :

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ALLEGRO_INCLUDE_DIR (ADVANCED)
used as include directory in directory /home/sendjasni/ptask/examples
used as include directory in directory /home/sendjasni/ptask/examples
used as include directory in directory /home/sendjasni/ptask/examples
used as include directory in directory /home/sendjasni/ptask/examples
used as include directory in directory /home/sendjasni/ptask/examples
used as include directory in directory /home/sendjasni/ptask/examples
used as include directory in directory /home/sendjasni/ptask/examples
used as include directory in directory /home/sendjasni/ptask/examples
used as include directory in directory /home/sendjasni/ptask/examples/activation_example
used as include directory in directory /home/sendjasni/ptask/examples/activation_example
used as include directory in directory /home/sendjasni/ptask/examples/activation_example
used as include directory in directory /home/sendjasni/ptask/examples/activation_example
used as include directory in directory /home/sendjasni/ptask/examples/activation_example
used as include directory in directory /home/sendjasni/ptask/examples/activation_example
used as include directory in directory /home/sendjasni/ptask/examples/activation_example
used as include directory in directory /home/sendjasni/ptask/examples/activation_example
used as include directory in directory /home/sendjasni/ptask/examples/advanced_act_test
used as include directory in directory /home/sendjasni/ptask/examples/advanced_act_test
used as include directory in directory /home/sendjasni/ptask/examples/advanced_act_test
used as include directory in directory /home/sendjasni/ptask/examples/advanced_act_test
used as include directory in directory /home/sendjasni/ptask/examples/advanced_act_test
used as include directory in directory /home/sendjasni/ptask/examples/advanced_act_test
used as include directory in directory /home/sendjasni/ptask/examples/advanced_act_test
used as include directory in directory /home/sendjasni/ptask/examples/advanced_act_test
used as include directory in directory /home/sendjasni/ptask/examples/system_example
used as include directory in directory /home/sendjasni/ptask/examples/system_example
used as include directory in directory /home/sendjasni/ptask/examples/system_example
used as include directory in directory /home/sendjasni/ptask/examples/system_example
used as include directory in directory /home/sendjasni/ptask/examples/system_example
used as include directory in directory /home/sendjasni/ptask/examples/system_example
used as include directory in directory /home/sendjasni/ptask/examples/system_example
used as include directory in directory /home/sendjasni/ptask/examples/system_example
used as include directory in directory /home/sendjasni/ptask/examples/system_example
used as include directory in directory /home/sendjasni/ptask/examples/system_example
used as include directory in directory /home/sendjasni/ptask/examples/system_example
used as include directory in directory /home/sendjasni/ptask/examples/system_example
used as include directory in directory /home/sendjasni/ptask/examples/system_example
used as include directory in directory /home/sendjasni/ptask/examples/system_example

-- Configuring incomplete, errors occurred!
See also "/home/sendjasni/ptask/build/CMakeFiles/CMakeOutput.log".
See also "/home/sendjasni/ptask/build/CMakeFiles/CMakeError.log".

errore nella compilazione

Riscontro questa serie di errori durante la compilazione:

Scanning dependencies of target ptask
[ 1%] Building C object src/CMakeFiles/ptask.dir/pbarrier.c.o
[ 3%] Building C object src/CMakeFiles/ptask.dir/pmutex.c.o
[ 5%] Building C object src/CMakeFiles/ptask.dir/ptask.c.o
[ 6%] Building C object src/CMakeFiles/ptask.dir/ptime.c.o
[ 8%] Building C object src/CMakeFiles/ptask.dir/rtmode.c.o
[ 10%] Building C object src/CMakeFiles/ptask.dir/tstat.c.o
[ 11%] Building C object src/CMakeFiles/ptask.dir/libdl.c.o
[ 13%] Building C object src/CMakeFiles/ptask.dir/dle_timer.c.o
[ 15%] Building C object src/CMakeFiles/ptask.dir/calibrate.c.o
[ 16%] Linking C static library libptask.a
[ 16%] Built target ptask
Scanning dependencies of target pbarr_example
[ 18%] Building C object examples/CMakeFiles/pbarr_example.dir/pbarr_example.c.o
[ 20%] Linking C executable pbarr_example
[ 20%] Built target pbarr_example
Scanning dependencies of target modes
[ 22%] Building C object examples/CMakeFiles/modes.dir/modes.c.o
[ 23%] Linking C executable modes
[ 23%] Built target modes
Scanning dependencies of target deadline_exception
[ 25%] Building C object examples/CMakeFiles/deadline_exception.dir/deadline_exception.c.o
[ 27%] Linking C executable deadline_exception
[ 27%] Built target deadline_exception
Scanning dependencies of target pcp
[ 28%] Building C object examples/CMakeFiles/pcp.dir/pcp.c.o
In file included from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:8:
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:24:20: error: conflicting types for ‘fadd’
__MATHCALL_NARROW (__MATHCALL_NAME (add), __MATHCALL_REDIR_NAME (add), 2);
^~~~~~~~~~~~~~~
In file included from /usr/local/include/allegro/base.h:41,
from /usr/local/include/allegro.h:25,
from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:7:
/usr/local/include/allegro/alcompat.h:44:7: note: previous definition of ‘fadd’ was here
AL_ALIAS(fixed fadd(fixed x, fixed y), fixadd(x, y))
^~~~~~~~
In file included from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:8:
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:27:20: error: conflicting types for ‘fdiv’
__MATHCALL_NARROW (__MATHCALL_NAME (div), __MATHCALL_REDIR_NAME (div), 2);
^~~~~~~~~~~~~~~
In file included from /usr/local/include/allegro/base.h:41,
from /usr/local/include/allegro.h:25,
from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:7:
/usr/local/include/allegro/alcompat.h:47:7: note: previous definition of ‘fdiv’ was here
AL_ALIAS(fixed fdiv(fixed x, fixed y), fixdiv(x, y))
^~~~~~~~
In file included from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:8:
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:30:20: error: conflicting types for ‘fmul’
__MATHCALL_NARROW (__MATHCALL_NAME (mul), __MATHCALL_REDIR_NAME (mul), 2);
^~~~~~~~~~~~~~~
In file included from /usr/local/include/allegro/base.h:41,
from /usr/local/include/allegro.h:25,
from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:7:
/usr/local/include/allegro/alcompat.h:46:7: note: previous definition of ‘fmul’ was here
AL_ALIAS(fixed fmul(fixed x, fixed y), fixmul(x, y))
^~~~~~~~
In file included from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:8:
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:33:20: error: conflicting types for ‘fsub’
__MATHCALL_NARROW (__MATHCALL_NAME (sub), __MATHCALL_REDIR_NAME (sub), 2);
^~~~~~~~~~~~~~~
In file included from /usr/local/include/allegro/base.h:41,
from /usr/local/include/allegro.h:25,
from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:7:
/usr/local/include/allegro/alcompat.h:45:7: note: previous definition of ‘fsub’ was here
AL_ALIAS(fixed fsub(fixed x, fixed y), fixsub(x, y))
^~~~~~~~
make[2]: *** [examples/CMakeFiles/pcp.dir/build.make:63: examples/CMakeFiles/pcp.dir/pcp.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:273: examples/CMakeFiles/pcp.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Feature Request : Live Refresh Via inotify or similar

Thanks for this excellent frontend for taskwarrior!

It would be awesome to use something like inotify to live-refresh on file change, avoiding the need (in most cases) for a manual refresh. Given the very small number of files in ~/.task typically, I imagine this would incur minimal overhead.

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.