51 lines
1.3 KiB
C
51 lines
1.3 KiB
C
#include <pthread.h>
|
|
#include <stdbool.h>
|
|
#include "simulateFlux.h"
|
|
#include "power.h"
|
|
#include "initialParameters.h"
|
|
#include "queue.h"
|
|
|
|
bool rawDataWriteFlag = 0, stopFlag = 0;
|
|
int nRow = 100000;
|
|
int nCol = 9;
|
|
double freqEch = 250;
|
|
|
|
Pqueue firstRawDataQueue;
|
|
|
|
int selectionCaptors[] = {1,2,3,4,5,6,7,8};
|
|
int sizeSelectionArray = 8;
|
|
|
|
int cptData = 0;
|
|
int cptFile = 1;
|
|
|
|
double period = 0;
|
|
double invTimeBandWidth = 0;
|
|
|
|
void *threadCalcul(void *vargp){
|
|
printf("start thread calcul\n");
|
|
Pqueue rawDataQueue = firstRawDataQueue;
|
|
while(queueGetNextE(rawDataQueue) != NULL){
|
|
printf("wile calcul\n");
|
|
//pthread_mutex_lock(&mutex);
|
|
power(queueGetTabChar(rawDataQueue),nRow,nCol,period,invTimeBandWidth);
|
|
/*remove(queueGetTabChar(rawDataQueue));
|
|
rawDataQueue = queueRmFrstE(rawDataQueue);*/
|
|
|
|
//pthread_mutex_unlock(&mutex);
|
|
}
|
|
}
|
|
|
|
int main(int argc , char** argv){
|
|
|
|
period = 1 / freqEch;
|
|
invTimeBandWidth = 1 /(nRow * period);
|
|
firstRawDataQueue = queueCreateEmpty(); // change this for create empty
|
|
|
|
pthread_t rawData;
|
|
pthread_create(&rawData , NULL, simulateFlux, (void *)&rawData);
|
|
|
|
pthread_t calcul;
|
|
//pthread_create(&calcul , NULL, threadCalcul, (void *)&calcul);
|
|
|
|
pthread_exit(NULL);
|
|
} |