Ignore:
Timestamp:
Oct 1, 2015, 4:20:46 PM (9 years ago)
Author:
alain
Message:

Major release: Change the task model to implement the POSIX threads API.

  • The shell "exec" and "kill" commands can be used to activate/de-activate the applications.
  • The "pause", "resume", and "context" commands can be used to stop, restart, a single thtead or to display the thread context.

This version has been tested on the following multi-threaded applications,
that have been modified to use the POSIX threads:

  • classif
  • convol
  • transpose
  • gameoflife
  • raycast
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_libs/user_lock.h

    r461 r709  
    88///////////////////////////////////////////////////////////////////////////////////
    99
    10 #ifndef _GIET_FILE_LOCK_H_
    11 #define _GIET_FILE_LOCK_H_
     10#ifndef _USER_LOCK_H_
     11#define _USER_LOCK_H_
     12
     13#include "hard_config.h"
    1214
    1315///////////////////////////////////////////////////////////////////////////////////
    14 //  lock structure
     16//  simple lock structure
    1517///////////////////////////////////////////////////////////////////////////////////
    1618
     
    2325
    2426///////////////////////////////////////////////////////////////////////////////////
    25 //  access functions
     27//  simple lock access functions
    2628///////////////////////////////////////////////////////////////////////////////////
    2729
     
    3537extern void lock_init( user_lock_t * lock );
    3638
     39///////////////////////////////////////////////////////////////////////////////////
     40//      SQT lock structures
     41///////////////////////////////////////////////////////////////////////////////////
     42
     43typedef struct sqt_lock_node_s
     44{
     45    unsigned int            current;         // current ticket index
     46    unsigned int            free;            // next free ticket index
     47    unsigned int            level;           // hierarchical level (0 is bottom)
     48    struct sqt_lock_node_s* parent;          // parent node (NULL for root)
     49    struct sqt_lock_node_s* child[4];        // children node
     50    unsigned int            padding[8];      // for 64 bytes alignment         
     51} sqt_lock_node_t;
     52
     53typedef struct sqt_lock_s
     54{
     55    sqt_lock_node_t* node[X_SIZE][Y_SIZE][5];  // array of pointers on SBT nodes
     56} sqt_lock_t;
     57
     58//////////////////////////////////////////////////////////////////////////////////
     59//      SQT lock access functions
     60//////////////////////////////////////////////////////////////////////////////////
     61
     62
     63extern void sqt_lock_init( sqt_lock_t*  lock,
     64                       unsigned int         x_size,
     65                       unsigned int         y_size,
     66                       unsigned int         ntasks );
     67
     68extern void sqt_lock_acquire( sqt_lock_t*  lock );
     69
     70extern void sqt_lock_release( sqt_lock_t*  lock );
     71
    3772#endif
    3873
Note: See TracChangeset for help on using the changeset viewer.