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_xml/xml_driver.c

    r645 r709  
    126126    unsigned int pseg_id;
    127127    unsigned int vseg_id;
    128     unsigned int task_id;
     128    unsigned int thread_id;
    129129    unsigned int proc_id;
    130130    unsigned int irq_id;
     
    135135    mapping_vspace_t * vspace;
    136136    mapping_vseg_t * vseg;
    137     mapping_task_t * task;
     137    mapping_thread_t * thread;
    138138    mapping_irq_t * irq;   
    139139    mapping_periph_t * periph;
     
    161161            MAPPING_VSPACE_SIZE * header->vspaces);
    162162
    163     // computes the base address for tasks array
    164     task = (mapping_task_t *) ((char *) header +
     163    // computes the base address for threads array
     164    thread = (mapping_thread_t *) ((char *) header +
    165165            MAPPING_HEADER_SIZE +
    166166            MAPPING_CLUSTER_SIZE * header->x_size * header->y_size +
     
    176176            MAPPING_VSPACE_SIZE * header->vspaces +
    177177            MAPPING_VSEG_SIZE * header->vsegs +
    178             MAPPING_TASK_SIZE * header->tasks +
     178            MAPPING_THREAD_SIZE * header->threads +
    179179            MAPPING_PROC_SIZE * header->procs);
    180180
     
    186186            MAPPING_VSPACE_SIZE * header->vspaces +
    187187            MAPPING_VSEG_SIZE * header->vsegs +
    188             MAPPING_TASK_SIZE * header->tasks +
     188            MAPPING_THREAD_SIZE * header->threads +
    189189            MAPPING_PROC_SIZE * header->procs +
    190190            MAPPING_IRQ_SIZE * header->irqs);
     
    342342        }
    343343
    344         //////////////////// tasks //////////////////////////////////////////////
    345 
    346         for (task_id = vspace[vspace_id].task_offset;
    347              task_id < (vspace[vspace_id].task_offset + vspace[vspace_id].tasks);
    348              task_id++)
     344        //////////////////// threads //////////////////////////////////////////////
     345
     346        for (thread_id = vspace[vspace_id].thread_offset;
     347             thread_id < (vspace[vspace_id].thread_offset + vspace[vspace_id].threads);
     348             thread_id++)
    349349        {
    350             unsigned int stack_vseg_id = task[task_id].stack_vseg_id;
    351             unsigned int heap_vseg_id  = task[task_id].heap_vseg_id;
    352             unsigned int cluster_id    = task[task_id].clusterid;
    353 
    354             fprintf(fpout, "            <task name=\"%s\"", task[task_id].name);
    355             fprintf(fpout, " trdid=\"%d\"", task[task_id].trdid);
     350            unsigned int stack_vseg_id = thread[thread_id].stack_vseg_id;
     351            unsigned int heap_vseg_id  = thread[thread_id].heap_vseg_id;
     352            unsigned int cluster_id    = thread[thread_id].clusterid;
     353
     354            fprintf(fpout, "            <thread name=\"%s\"", thread[thread_id].name);
     355            fprintf(fpout, " trdid=\"%d\"", thread[thread_id].trdid);
    356356            fprintf(fpout, " x=\"%d\"", cluster[cluster_id].x);
    357357            fprintf(fpout, " y=\"%d\"", cluster[cluster_id].y);
    358             fprintf(fpout, " p=\"%d\"", task[task_id].proclocid);
     358            fprintf(fpout, " p=\"%d\"", thread[thread_id].proclocid);
    359359            fprintf(fpout, "\n                 ");     
    360360            fprintf(fpout, " stackname=\"%s\"", vseg[stack_vseg_id].name);
    361361            if (heap_vseg_id != -1)
    362362            fprintf(fpout, " heapname=\"%s\"", vseg[heap_vseg_id].name);
    363             fprintf(fpout, " startid = \"%d\"", task[task_id].startid);
     363            fprintf(fpout, " startid = \"%d\"", thread[thread_id].startid);
    364364            fprintf(fpout, " />\n");
    365365        }
Note: See TracChangeset for help on using the changeset viewer.