Changeset de737c8


Ignore:
Timestamp:
Oct 30, 2017, 2:58:42 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
2c1830a6
Parents:
bd7f401
Message:

Added new sort function for monitors

Location:
src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/benchmark/Makefile.am

    rbd7f401 rde737c8  
    9797
    9898mutex-function$(EXEEXT):
    99         @BACKEND_CC@ mutex/function.c -DBENCH_N=500000000      -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     99        @BACKEND_CC@ mutex/function.c    -DBENCH_N=5000000000  -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    100100
    101101mutex-pthread_lock$(EXEEXT):
    102         @BACKEND_CC@ mutex/pthreads.c -DBENCH_N=50000000       -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     102        @BACKEND_CC@ mutex/pthreads.c    -DBENCH_N=50000000    -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    103103
    104104mutex-upp$(EXEEXT):
    105         u++          mutex/upp.cc     -DBENCH_N=50000000       -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     105        u++          mutex/upp.cc        -DBENCH_N=50000000    -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    106106
    107107mutex-cfa1$(EXEEXT):
    108         ${CC}        mutex/cfa1.c     -DBENCH_N=5000000        -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     108        ${CC}        mutex/cfa1.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    109109
    110110mutex-cfa2$(EXEEXT):
    111         ${CC}        mutex/cfa2.c     -DBENCH_N=5000000        -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     111        ${CC}        mutex/cfa2.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    112112
    113113mutex-cfa4$(EXEEXT):
    114         ${CC}        mutex/cfa4.c     -DBENCH_N=5000000        -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     114        ${CC}        mutex/cfa4.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    115115
    116116## =========================================================================================================
  • src/benchmark/Makefile.in

    rbd7f401 rde737c8  
    510510
    511511mutex-function$(EXEEXT):
    512         @BACKEND_CC@ mutex/function.c -DBENCH_N=500000000      -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     512        @BACKEND_CC@ mutex/function.c    -DBENCH_N=5000000000  -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    513513
    514514mutex-pthread_lock$(EXEEXT):
    515         @BACKEND_CC@ mutex/pthreads.c -DBENCH_N=50000000       -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     515        @BACKEND_CC@ mutex/pthreads.c    -DBENCH_N=50000000    -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    516516
    517517mutex-upp$(EXEEXT):
    518         u++          mutex/upp.cc     -DBENCH_N=50000000       -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     518        u++          mutex/upp.cc        -DBENCH_N=50000000    -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    519519
    520520mutex-cfa1$(EXEEXT):
    521         ${CC}        mutex/cfa1.c     -DBENCH_N=5000000        -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     521        ${CC}        mutex/cfa1.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    522522
    523523mutex-cfa2$(EXEEXT):
    524         ${CC}        mutex/cfa2.c     -DBENCH_N=5000000        -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     524        ${CC}        mutex/cfa2.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    525525
    526526mutex-cfa4$(EXEEXT):
    527         ${CC}        mutex/cfa4.c     -DBENCH_N=5000000        -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     527        ${CC}        mutex/cfa4.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
    528528
    529529signal$(EXEEXT) :\
  • src/libcfa/concurrency/monitor.c

    rbd7f401 rde737c8  
    2121#include "kernel_private.h"
    2222
     23#include "bits/algorithms.h"
     24
    2325//-----------------------------------------------------------------------------
    2426// Forward declarations
     
    291293
    292294        // Sort monitors based on address -> TODO use a sort specialized for small numbers
    293         qsort(this.m, count);
     295        __libcfa_small_sort(this.m, count);
    294296
    295297        // Save previous thread context
     
    492494        set_owner( monitors, count, signallee );
    493495
     496        LIB_DEBUG_PRINT_BUFFER_DECL( "Kernel : signal_block condition %p (s: %p)\n", this, signallee );
     497
    494498        //Everything is ready to go to sleep
    495499        BlockInternal( locks, count, &signallee, 1 );
     
    498502        // WE WOKE UP
    499503
     504
     505        LIB_DEBUG_PRINT_BUFFER_LOCAL( "Kernel :   signal_block returned\n" );
    500506
    501507        //We are back, restore the masks and recursions
     
    869875        short size = 0;
    870876        for( int i = 0; i < mask.size; i++ ) {
    871                 qsort( mask.clauses[i].list, mask.clauses[i].size );
     877                __libcfa_small_sort( mask.clauses[i].list, mask.clauses[i].size );
    872878                for( int j = 0; j < mask.clauses[i].size; j++) {
    873879                        insert_unique( storage, size, mask.clauses[i].list[j] );
     
    875881        }
    876882        // TODO insertion sort instead of this
    877         qsort( storage, size );
     883        __libcfa_small_sort( storage, size );
    878884        return size;
    879885}
Note: See TracChangeset for help on using the changeset viewer.