From 7a6f332f722b50a0bef87db34bd7e4f65a2bb667 Mon Sep 17 00:00:00 2001 From: hiGepi Date: Sat, 19 Nov 2022 16:11:18 +0100 Subject: [PATCH] =?UTF-8?q?todo=20complet=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Etienne/acquisitionManagerPOSIX_Etienne.c | 173 ++++++++++++++++++ .../Etienne/acquisitionManager_Etienne.h | 18 ++ T2/tp/exercice-1/acquisitionManager.h | 12 +- T2/tp/exercice-1/acquisitionManagerPOSIX.c | 154 ++++++++-------- T2/tp/exercice-1/acquisitionManagerPOSIX.o | Bin 0 -> 6264 bytes T2/tp/exercice-1/display.o | Bin 0 -> 2192 bytes T2/tp/exercice-1/displayManager.c | 18 +- T2/tp/exercice-1/displayManager.o | Bin 0 -> 2864 bytes T2/tp/exercice-1/messageAdder.c | 28 ++- T2/tp/exercice-1/messageAdder.o | Bin 0 -> 3304 bytes T2/tp/exercice-1/msg.o | Bin 0 -> 2096 bytes T2/tp/exercice-1/multitaskingAccumulator.o | Bin 0 -> 2864 bytes T2/tp/exercice-1/multitaskingAccumulatorPosix | Bin 0 -> 18928 bytes T2/tp/exercice-1/preambule | Bin 17384 -> 0 bytes T2/tp/exercice-1/preambule.o | Bin 4520 -> 0 bytes T2/tp/exercice-1/sensorManager.o | Bin 0 -> 1608 bytes 16 files changed, 311 insertions(+), 92 deletions(-) create mode 100755 T2/tp/exercice-1/Etienne/acquisitionManagerPOSIX_Etienne.c create mode 100755 T2/tp/exercice-1/Etienne/acquisitionManager_Etienne.h create mode 100644 T2/tp/exercice-1/acquisitionManagerPOSIX.o create mode 100644 T2/tp/exercice-1/display.o create mode 100644 T2/tp/exercice-1/displayManager.o create mode 100644 T2/tp/exercice-1/messageAdder.o create mode 100644 T2/tp/exercice-1/msg.o create mode 100644 T2/tp/exercice-1/multitaskingAccumulator.o create mode 100755 T2/tp/exercice-1/multitaskingAccumulatorPosix delete mode 100755 T2/tp/exercice-1/preambule delete mode 100644 T2/tp/exercice-1/preambule.o create mode 100644 T2/tp/exercice-1/sensorManager.o diff --git a/T2/tp/exercice-1/Etienne/acquisitionManagerPOSIX_Etienne.c b/T2/tp/exercice-1/Etienne/acquisitionManagerPOSIX_Etienne.c new file mode 100755 index 0000000..0b5a0b7 --- /dev/null +++ b/T2/tp/exercice-1/Etienne/acquisitionManagerPOSIX_Etienne.c @@ -0,0 +1,173 @@ +#include +#include +#include +#include +#include +#include +#include "acquisitionManager.h" +#include "msg.h" +#include "iSensor.h" +#include "multitaskingAccumulator.h" +#include "iAcquisitionManager.h" +#include "debug.h" + + +//producer count storage +volatile unsigned int produceCount = 0; + +pthread_t producers[4]; + +static void *produce(void *params); + +//Le tampon pour stocker les messages +MSG_BLOCK buffer[BUFFER_SIZE]; + +int index_buffer_libre = 0; + +int nbr_threads = 0; + +/** +* Semaphores and Mutex +*/ +sem_t *semaphore_libre; +sem_t *semaphore_occupe; + +pthread_mutex_t mutex_tab_indices = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t mutex_count = PTHREAD_MUTEX_INITIALIZER; + +/* +* Creates the synchronization elements. +* @return ERROR_SUCCESS if the init is ok, ERROR_INIT otherwise +*/ +static unsigned int createSynchronizationObjects(void); + +/* +* Increments the produce count. +*/ +static void incrementProducedCount(void); + +static unsigned int createSynchronizationObjects(void) +{ + + //Initialisation des sémaphores + semaphore_libre = sem_open("/acquisitionManager_semLibre", O_CREAT, 0644, BUFFER_SIZE); + if (semaphore_libre == SEM_FAILED) + { + perror("[sem_open"); + return ERROR_INIT; + } + + semaphore_occupe = sem_open("/acquisitionManager_semLibre", O_CREAT, 0644, 0); + if (semaphore_occupe == SEM_FAILED) + { + perror("[sem_open"); + return ERROR_INIT; + } + //----Fin de l'initialisation sémaphore ----- + printf("[acquisitionManager]Semaphore created\n"); + return ERROR_SUCCESS; +} + +static void incrementProducedCount(void) +{ + pthread_mutex_lock(&mutex_count); + produceCount++; + pthread_mutex_unlock(&mutex_count); +} + +unsigned int getProducedCount(void) +{ + unsigned int p = 0; + pthread_mutex_lock(&mutex_count); + p = produceCount; + pthread_mutex_unlock(&mutex_count); + return p; +} + +MSG_BLOCK getMessage(void){ + //TODO + MSG_BLOCK message; + + static int index_lecture = 0; + sem_wait(semaphore_occupe); + + message = buffer[index_lecture]; + index_lecture = (index_lecture+1)%BUFFER_SIZE; + + sem_post(semaphore_libre); + + return message; +} + +//TODO create accessors to limit semaphore and mutex usage outside of this C module. + +unsigned int acquisitionManagerInit(void) +{ + unsigned int i; + printf("[acquisitionManager]Synchronization initialization in progress...\n"); + fflush( stdout ); + if (createSynchronizationObjects() == ERROR_INIT) + return ERROR_INIT; + + printf("[acquisitionManager]Synchronization initialization done.\n"); + + for (i = 0; i < PRODUCER_COUNT; i++) + { + pthread_create(&producers[i], NULL, produce, NULL); + } + + return ERROR_SUCCESS; +} + +void acquisitionManagerJoin(void) +{ + unsigned int i; + for (i = 0; i < PRODUCER_COUNT; i++) + { + pthread_join(producers[i], NULL); + } + + sem_destroy(semaphore_libre); + sem_destroy(semaphore_occupe); + printf("[acquisitionManager]Semaphore cleaned\n"); +} + +void *produce(void* params) +{ + //D(printf("[acquisitionManager]Producer created with id %d\n", gettid())); + unsigned int i = 0; + int index_loc; + MSG_BLOCK message; + + //Récupérer le numéro du thread + int num_thread; + pthread_mutex_lock(&mutex_count); + nbr_threads++; + num_thread = nbr_threads; + pthread_mutex_unlock(&mutex_count); + + while (i < PRODUCER_LOOP_LIMIT) + { + i++; + sleep(PRODUCER_SLEEP_TIME+(rand() % 5)); + + //----- L'ajout d'un nouveau message ----- + //On prend un jeton : une case se remplit + sem_wait(semaphore_libre); + + pthread_mutex_lock(&mutex_tab_indices); + index_loc = index_buffer_libre; + index_buffer_libre = (index_buffer_libre+1)%BUFFER_SIZE; + pthread_mutex_unlock(&mutex_tab_indices); + + //Récupérer l'entrée + getInput(num_thread, &message); + buffer[index_loc] = message; + + //On met un jeton dans le sémaphore "occupé" + sem_post(semaphore_occupe); + } + //printf("[acquisitionManager] %d termination\n", get_id()); + + pthread_exit(NULL); +} diff --git a/T2/tp/exercice-1/Etienne/acquisitionManager_Etienne.h b/T2/tp/exercice-1/Etienne/acquisitionManager_Etienne.h new file mode 100755 index 0000000..529f3d8 --- /dev/null +++ b/T2/tp/exercice-1/Etienne/acquisitionManager_Etienne.h @@ -0,0 +1,18 @@ +#ifndef ACQUISITION_MANAGER_H +#define ACQUISITION_MANAGER_H + +/** +* Initializes the acquisitions +*/ +unsigned int acquisitionManagerInit(void); + +/** +* Waits that acquisitions terminate +*/ +void acquisitionManagerJoin(void); + + +//La taille du tampon +#define BUFFER_SIZE 13 + +#endif diff --git a/T2/tp/exercice-1/acquisitionManager.h b/T2/tp/exercice-1/acquisitionManager.h index 529f3d8..7ead12c 100755 --- a/T2/tp/exercice-1/acquisitionManager.h +++ b/T2/tp/exercice-1/acquisitionManager.h @@ -1,6 +1,12 @@ #ifndef ACQUISITION_MANAGER_H #define ACQUISITION_MANAGER_H +/** + * Initializes constants +*/ + +#define BUFFER_SIZE 13 + /** * Initializes the acquisitions */ @@ -11,8 +17,4 @@ unsigned int acquisitionManagerInit(void); */ void acquisitionManagerJoin(void); - -//La taille du tampon -#define BUFFER_SIZE 13 - -#endif +#endif \ No newline at end of file diff --git a/T2/tp/exercice-1/acquisitionManagerPOSIX.c b/T2/tp/exercice-1/acquisitionManagerPOSIX.c index 0b5a0b7..9c2d0bb 100755 --- a/T2/tp/exercice-1/acquisitionManagerPOSIX.c +++ b/T2/tp/exercice-1/acquisitionManagerPOSIX.c @@ -19,22 +19,24 @@ pthread_t producers[4]; static void *produce(void *params); -//Le tampon pour stocker les messages -MSG_BLOCK buffer[BUFFER_SIZE]; - -int index_buffer_libre = 0; - -int nbr_threads = 0; +MSG_BLOCK Buffer[BUFFER_SIZE]; /** * Semaphores and Mutex */ -sem_t *semaphore_libre; -sem_t *semaphore_occupe; +//TODO +sem_t semaphore_libre; +sem_t semaphore_occupe; -pthread_mutex_t mutex_tab_indices = PTHREAD_MUTEX_INITIALIZER; -pthread_mutex_t mutex_count = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t m_count = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t m_write = PTHREAD_MUTEX_INITIALIZER; +/** + * Usefull variables + */ + +int index_libre = 0; +int thread_count = 0; /* * Creates the synchronization elements. * @return ERROR_SUCCESS if the init is ok, ERROR_INIT otherwise @@ -48,55 +50,53 @@ static void incrementProducedCount(void); static unsigned int createSynchronizationObjects(void) { + int error; - //Initialisation des sémaphores - semaphore_libre = sem_open("/acquisitionManager_semLibre", O_CREAT, 0644, BUFFER_SIZE); - if (semaphore_libre == SEM_FAILED) - { - perror("[sem_open"); - return ERROR_INIT; - } - - semaphore_occupe = sem_open("/acquisitionManager_semLibre", O_CREAT, 0644, 0); - if (semaphore_occupe == SEM_FAILED) - { - perror("[sem_open"); - return ERROR_INIT; - } - //----Fin de l'initialisation sémaphore ----- + //TODO DONE + if((error = sem_init(&semaphore_libre, 0, BUFFER_SIZE)) < 0){ + printf("[acquisitionManager]Semaphore L Error No. %d\n",error); + return error; + } + + if((error = sem_init(&semaphore_occupe, 0, 0)) < 0){ + printf("[acquisitionManager]Semaphore O Error No. %d\n",error); + return error; + } + printf("[acquisitionManager]Semaphore created\n"); return ERROR_SUCCESS; } static void incrementProducedCount(void) { - pthread_mutex_lock(&mutex_count); - produceCount++; - pthread_mutex_unlock(&mutex_count); + //TODO DONE + pthread_mutex_lock(&m_count); + produceCount++; + pthread_mutex_unlock(&m_count); } unsigned int getProducedCount(void) { + //TODO DONE unsigned int p = 0; - pthread_mutex_lock(&mutex_count); - p = produceCount; - pthread_mutex_unlock(&mutex_count); + pthread_mutex_lock(&m_count); + p = produceCount; + pthread_mutex_unlock(&m_count); return p; } MSG_BLOCK getMessage(void){ //TODO - MSG_BLOCK message; - - static int index_lecture = 0; - sem_wait(semaphore_occupe); - - message = buffer[index_lecture]; - index_lecture = (index_lecture+1)%BUFFER_SIZE; - - sem_post(semaphore_libre); - - return message; + MSG_BLOCK res; + static int index_count = 0; + + sem_wait(&semaphore_occupe); + res = Buffer[index_count]; + index_count = (index_count+1)%BUFFER_SIZE; + incrementProducedCount(); + sem_post(&semaphore_libre); + + return res; } //TODO create accessors to limit semaphore and mutex usage outside of this C module. @@ -110,10 +110,11 @@ unsigned int acquisitionManagerInit(void) return ERROR_INIT; printf("[acquisitionManager]Synchronization initialization done.\n"); - + for (i = 0; i < PRODUCER_COUNT; i++) { - pthread_create(&producers[i], NULL, produce, NULL); + //TODO DONE + pthread_create(&producers[i], NULL, produce, NULL); } return ERROR_SUCCESS; @@ -124,50 +125,49 @@ void acquisitionManagerJoin(void) unsigned int i; for (i = 0; i < PRODUCER_COUNT; i++) { + //TODO DONE pthread_join(producers[i], NULL); } - sem_destroy(semaphore_libre); - sem_destroy(semaphore_occupe); + //TODO DONE + sem_destroy(&semaphore_libre); + sem_destroy(&semaphore_occupe); + printf("[acquisitionManager]Semaphore cleaned\n"); } void *produce(void* params) { - //D(printf("[acquisitionManager]Producer created with id %d\n", gettid())); + D(printf("[acquisitionManager]Producer created with id %d\n", getpid())); unsigned int i = 0; - int index_loc; - MSG_BLOCK message; - - //Récupérer le numéro du thread - int num_thread; - pthread_mutex_lock(&mutex_count); - nbr_threads++; - num_thread = nbr_threads; - pthread_mutex_unlock(&mutex_count); - + int index_lock; + int thread_num; + MSG_BLOCK message; + + //Counting producers + pthread_mutex_lock(&m_count); + thread_num = thread_count; + thread_count++; + pthread_mutex_unlock(&m_count); + while (i < PRODUCER_LOOP_LIMIT) { i++; sleep(PRODUCER_SLEEP_TIME+(rand() % 5)); - - //----- L'ajout d'un nouveau message ----- - //On prend un jeton : une case se remplit - sem_wait(semaphore_libre); - - pthread_mutex_lock(&mutex_tab_indices); - index_loc = index_buffer_libre; - index_buffer_libre = (index_buffer_libre+1)%BUFFER_SIZE; - pthread_mutex_unlock(&mutex_tab_indices); - - //Récupérer l'entrée - getInput(num_thread, &message); - buffer[index_loc] = message; - - //On met un jeton dans le sémaphore "occupé" - sem_post(semaphore_occupe); + //TODO DONE + sem_wait(&semaphore_libre); + + pthread_mutex_lock(&m_write); + index_lock = index_libre; + index_libre = (index_libre + 1)%BUFFER_SIZE; + pthread_mutex_unlock(&m_write); + + getInput(thread_num, &message); + Buffer[index_lock] = message; + + sem_post(&semaphore_occupe); } - //printf("[acquisitionManager] %d termination\n", get_id()); - - pthread_exit(NULL); -} + printf("[acquisitionManager] %d termination\n", getpid()); + //TODO DONE + pthread_exit(NULL); +} \ No newline at end of file diff --git a/T2/tp/exercice-1/acquisitionManagerPOSIX.o b/T2/tp/exercice-1/acquisitionManagerPOSIX.o new file mode 100644 index 0000000000000000000000000000000000000000..ee961cd23c603d667acb2a2ec45e540a48509ee8 GIT binary patch literal 6264 zcmbVPe{38_6`u3i$u)5{mo^1Mq1iM}WYc)%OPrEW5&8Ucj$Yyr+YKm0m&@IreaZRm zy0@p=Z53)cjk2X?as_M-+S}ko7tJ!ulL6L>H-0#B*6BvrItb&o8P!p?-bQerm=PG!}Sk; z96iJkt%oIjaOc4ZiL27 zRO*@DiiNUO>1hr)4Ty+d@#3i~&MePf9m!-evmb5ZvmbA6eY>*pTdh|r;{li9da|M( zPYDkfjUNi|)J5kVo~;hdUD_{f%|Ft5xzgBKsXxvS(fSc@{oUkjJp?yT5Sl!-4g=@T4eng#&f6I4)WrY~T;>(Gr_wR``tv}6keqiQZ_}%s)sRYM z-pwbUt&z-WF`<$?RizV5V}ixf9C!ZCoqxnC&ozfIu`#Ej^QLWnkdy zO7orWax1Unlb0~!xX6hJGLtdZZ#so>va>3mV%dt>h*XCM-CRtIB_ryQyFbV9sgEyI z$F0cK$XyS1QqHEdI+AiE%aHl$6N$K4ATjVY7ycfCa>P)>EitYJJ z`R3tB^@y0w=TXanOjBP4_x5*Takv5b_TPGTfv%t7!9^EN=zMA}#HSyJIAB0`mdf&osT zito6K{DJ?GpR&xPZK7dcyZ=3&bRlo5F#Pow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E!EkvQg=@*gC8{9{(*ZYKOK1aBdHjo^boYo$#rjzbE{5V&~6R$Ge2d_$Fmpr(-2Qi~GF=i)^L1|lV zIjU-wnM)dQ)v%e7PTEOk94nQW0S7uXkRCC1Gb2?P8#Cc(H}VDBG~idZO&sO2J(4dQ za4#yFmOTNgXwV!@WUSg(7bqWo9T zQ&2&hUj49~x0{M6ORs(oaKHH%mptejmwGt=csEq~YX1GkMwNLv{&_i%jey~~=G8}= i-nj>e{SXHPx#mfjrwRW+{`%v1c!NCa7K?AM{(k@<%O@oO literal 0 HcmV?d00001 diff --git a/T2/tp/exercice-1/display.o b/T2/tp/exercice-1/display.o new file mode 100644 index 0000000000000000000000000000000000000000..697aff4aad009a5497bf458bd59347468b095b10 GIT binary patch literal 2192 zcmbtUPiqrV5TBT8qt+&hf>8ggpkkqYWJ`tGgKQex*2NjKY#2OW4jGru>#dGF1ew=bqkGe;5$5J|vo zIPe4o_|kV^8@_2k8V2EK`qEx;^Ly$mVV{Vp?-Vybr;2ZH67r2c)v8Kgenl2+Q+#gg z*Vf+Ft{YL7Y3OU8{^} z`DVjy*AKy*%+=QHsz;HSwvf+HYBv^_+6}L*-BRN!JF2&RPk%m^RoQW+4+l7HfsUQQ zaTG`4?jjrk*dZ*5gXCnj>8K*@CC#vf0lD}?u`3Vl|hyAS^DU}J$WZ+SuhKw zxv5;qoST_>FuhIA3#m($V)oU_;tpkFZdnL zM-}A=%LqD@^I!Qoaw+E+jx(vUB98xo3DNq=`Gr5n{7!!{ZI|#u9gOA7w38(8Ir_qYz8@&HFoyfq5^8Wza C(bA0o literal 0 HcmV?d00001 diff --git a/T2/tp/exercice-1/displayManager.c b/T2/tp/exercice-1/displayManager.c index 44f6f0c..3d1a292 100755 --- a/T2/tp/exercice-1/displayManager.c +++ b/T2/tp/exercice-1/displayManager.c @@ -19,21 +19,29 @@ static void *display( void *parameters ); void displayManagerInit(void){ - //TODO + // TODO DONE + pthread_create(&displayThread, NULL, display, NULL); } void displayManagerJoin(void){ - //TODO + //TODO DONE + pthread_join(displayThread, NULL); } static void *display( void *parameters ) { - //D(printf("[displayManager]Thread created for display with id %d\n", gettid())); + D(printf("[displayManager]Thread created for display with id %d\n", getpid())); unsigned int diffCount = 0; + MSG_BLOCK mBlock; while(diffCount < DISPLAY_LOOP_LIMIT){ sleep(DISPLAY_SLEEP_TIME); //TODO + diffCount++; + mBlock = getCurrentSum(); + messageDisplay(&mBlock); + print(getProducedCount(),getConsumedCount()); } - //printf("[displayManager] %d termination\n", gettid()); - //TODO + printf("[displayManager] %d termination\n", getpid()); + //TODO DONE + pthread_exit(NULL); } diff --git a/T2/tp/exercice-1/displayManager.o b/T2/tp/exercice-1/displayManager.o new file mode 100644 index 0000000000000000000000000000000000000000..5b336ebee7a293f444fb21ae5e27642ccfc02d43 GIT binary patch literal 2864 zcmbuAPiP!v6u{qR(j;oTNvp+R#f;FF6zs4QD^x|<&F0UftTvdWSVYFj&NNw@on2>V zB&nd$R_zd1JP3O5P!C0q9z5uwbm>9yre3@hEL3SlskDV0L|Nba=KFTPOlL0o;G6fp z-@Nzc`}^jN$pB>qw07#%<$# zDZIMT7xtIJYut^gLii2S6X9m~ZA4E0lL_`S^CFGiXg-Ed2rua^2K6>mgCi3-!VBc_ z`&)w}XUK<*U;oZ%?tZl0ZtI&y^C_ag(S!NZ{EQ6-^-YH96~GI2rBPq8)}FCkYsv9m zRQK7c?|9XUYx$L$dpE#zvG{~Ky093yexN?C9nx|K^?>#C*T-^N?vSP*h&biLWq~1V z+ptYPy8yVFEn>7tB=xG-`r1whV$)P!jS!|6`*sQlQ z>M3j$wsIO*kCdOymAfb)9Zo4sfdQ%4H5It4+u_y&Ow;P$DGK!60Y{L~y2XV~UJ`#Y zh0mn$=Tmqkg`Y~{>nZ%*6#iif{}lNyT>lno5^;9EM0+RPYKxT?`V#V_b@%}}<+*~I zM4Y!@&`$D)t@lhT3jkWFm;-aVbacE>GLKG8%}vgm^M&!!qzR1`$Em}T;}-+Zb6kHe zs6y3gH1MWQMAw$RthtS#>e$5^UQq(GUd;~50@S@qgzFU>Op|p_nC0b@Q1_QT$Ffal zwc?B6@H#N#cF{cZ>Ufti#&=@=M`{(f)jf5bUee=K?(|8tzvcd2%XJfBH?x5R(sobuc+@oOpk zC(bGVu;hP3;&i9QcU8_QKQ$q<+z`CQ`*w_9;eF5=YgOM`MD2T#UKW<;tXP`wtooqY zmT!T!*l2);hYCC7u4{)uE7z)3Jd&WfHQ&*&)E{j4R{13FFS&tM_iA;=^Vcwx5<1J~ z3D2rJVgUb7s~Ao-JYLcA$VhHQs`HHBNxJv6=J}3CWPHp^=PV^hxd$7Wq8`v5k?hAt zJpM-*<8kC8OB~bxj&lCjcpYOY=NL9w4)YH^EJL)#_{BK#$jHuNljS&fpz+Bf;)JGp zFKpTG?If7sdmLFmHu(%wp0hk&rH&+G`~tm#2D!%LKj-mv;mCD7eg%2b{$J+@%HVOd z|MZs?@nZjzzD*&+d_ZTp-j0k~Jf3pK_Z|_Pqd}qEj8x~zr`73GtxJl}(W0Wf7OBoN G9{(@P{fKk` literal 0 HcmV?d00001 diff --git a/T2/tp/exercice-1/messageAdder.c b/T2/tp/exercice-1/messageAdder.c index cb01c8f..90e76fa 100755 --- a/T2/tp/exercice-1/messageAdder.c +++ b/T2/tp/exercice-1/messageAdder.c @@ -29,11 +29,13 @@ static void *sum( void *parameters ); MSG_BLOCK getCurrentSum(){ - //TODO + //TODO DONE + return out; } unsigned int getConsumedCount(){ //TODO + return consumeCount; } @@ -43,24 +45,40 @@ void messageAdderInit(void){ { out.mData[i] = 0; } - //TODO + //TODO DONE + pthread_create(&consumer, NULL, sum, NULL); } void messageAdderJoin(void){ - //TODO + //TODO DONE + pthread_join(consumer, NULL); +} + +static void incrementConsumeCount(void){ + // pthread_mutex_lock(&m_count); + consumeCount++; + // pthread_mutex_unlock(&m_count); } static void *sum( void *parameters ) { - //D(printf("[messageAdder]Thread created for sum with id %d\n", gettid())); + D(printf("[messageAdder]Thread created for sum with id %d\n",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$VxI^8&W;M5ev`0^)xA&!0rTF0}vjig7;Qf4{kD ss$Die?}Oeo8eTrt^zJ=EFwMXWIWA#k8wkCBe*7r?6v{nEHNIZ{A8dQmQ~&?~ literal 0 HcmV?d00001 diff --git a/T2/tp/exercice-1/multitaskingAccumulator.o b/T2/tp/exercice-1/multitaskingAccumulator.o new file mode 100644 index 0000000000000000000000000000000000000000..64e97b4011a9c5381f9c100f3cfa6b995a172e1a GIT binary patch literal 2864 zcmbuA&1(}u6u@6h)%w-e`i&wH5kIhFQY%yiNm}}$#8zy?f=HYu+hl378+T{vhoFKN zJqY6e;K{pqvqvvpyy(%3;K7S{5fSQpvoq;r-SwakX6C)$yf^b^clParvEulKR0_1D z;1aA`ngX;ouj_fK=AjpQ;8rte2wQM}!FFneN+m#>3)j0n!6uwd2Y?Ke4jD4Rj-=3P6?Neu2FRzONA!J%~a}EHE3W~v0Em_mFk|wtA0jUUek8C zu&V7GDcA44hkst1oqT$Zj5qY8a;uY%zIJ~hJJNM}$;lWL36g6nx7@0n%&o}*CPqgu zWKP_e3mg$-&a)ww9moaJ%H1E#vg{DcoeViZ7pBvPZ6mgcsT;5XV3k-J8_Di)fYi!$ zNGHFSth7939Pj=UO8+ehyyI0%pM$ceC)X(%X?DS6Cx&B+KaB8GiocFTuI5)RQJUu=>Ggc~>3M0j_GL*|L&vwLoxl&&MUb!3CJ{BO?xyl`0v%Je#j-ZLv z2aQ6tszBBDTMfQ!`gEczE^cUsN$}_L5?f2SM=1KH(M_k@^=mDZ18Sab)=q;THh90m zj~aZJ!A}^RzG=Na-5(O#cN;d%FA_wF?mH4<>AxLy?LVb>)PKg{dkp_sgYPx?ZG-PK zxUD$lxx?Ts#iRQ!8hpRupHZCF*`#ziFn_rz_#7}_c;Q&rny{7xuqqcE*qrYJ^IS5> zGslL}v>Kd|6B6!;parbrHk+1%QI0DthJ|$irz#7|t~mk2pIgiF#Ig#v>g9QlH!U-z z|Iw))QLXJbBieavaYDYP96^Ja{txK6yjCJ(H2yfwQ&s)f_|q6mYYt*FC9jOnCPZCV zaGeMFksdvNRypW8i7ry2wUX{X-Ko5sUGMH}4E4HNhrR(qdVjiWB=kLyOO^~nUaB}c zpD7B<7~)iqH8cG_#K9Qf8Z!D@&^Ya|)JZ^8=DytHjRU_4c-k5l*r_sBI2p&^XDDT6e-K%4@ZK}0#@t;)w LPuiZL5{>^2)%lOO literal 0 HcmV?d00001 diff --git a/T2/tp/exercice-1/multitaskingAccumulatorPosix b/T2/tp/exercice-1/multitaskingAccumulatorPosix new file mode 100755 index 0000000000000000000000000000000000000000..3c934e3673f01ef62cf6e235d4f5bf7b38cb6ee9 GIT binary patch literal 18928 zcmeHPeRN#Kb)VHrSQvXPzz)KE_(2TV0k0*nT^XXXD@*p15!fI*HZ^9o-d#zHrCnt| zf(%KpBXHOwFEJ%4 zbD!Qm?LyM_kG4nSv$`|Cx%bY@ojWt{&AjnFEp5vyTrR=EE&fhL)V@#&1ZCLICs zi3Twpf9Hsc#TiIfN=)VZ6hW>EhboF`wZ`3`Bv(t367)g^3#ME{q9j)?bWc?|Oht`K zlUx-=b=pZ=rYSzAoNtw9sC?m|9a9v})GkN1nYTdY&uc8EIc=9+pH?`_5lnIoTCPFM zF%?>lDch55Lca!WPbW2yN5PPPg>cHP*K$tUtofNz85G*zNQM6^<*n9o<|maNCw)=D zf+?4GGvvrFzi;4fzD1W;t{VNZ0^l0^%9!V7w$v2_1}{)QzBmMron$BOr6H^X+;oVuUK9a6*y|(wEg{*_hBpwPR z&s|Juihlw>;!*A2hD43T0Eu}Q?YQt@%3@ZSX zYFBj`JM@>~f4>ZV68PC-wlI8%Anwu*D*g+9?@M(jBEc{@d7TKfuDLM~jwB*o z(PS!;SaajDo_H*>Cb+35qVh`SBqO~LN~RL=ErQ~A2BRsV^#<;UM`KnZgrZUrE7_Y) zMfw9h@z7=qiuBuLRem}qIY@IfhFpsD#gi$4+J~s#OGIa9PdeEx0)f6nG?wZNgt|8) zkxT_cn<*aX3`ToIS0vRJ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X-?$E(X8H~?X4vF;AFFPGl3>1a@*g0Be3#4T{aF70X4o(^{wT0M z?#I6dM(wxc_4!bPeo;O^Lbky2OwWL@U0(P!bDg4G4y#}}PEUg{VO+l9Q#mzS{;{RZ zsi;w$6ld%5HM^C|@>g1jicnoC*eUyt%29uPTA@$B_+A9K0Y9!k&p$Lgxb8|){oQ(< bq7ULd(H^*5#%Q>gl0Vz8IA%Kp97*w?O%gj4 literal 0 HcmV?d00001 diff --git a/T2/tp/exercice-1/preambule b/T2/tp/exercice-1/preambule deleted file mode 100755 index 6e69c5117cd9d3c8f16bf4d97336e7c78e3dfef8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17384 zcmeHPeQcY>8Nb90O-t*B(m?s_3oEFM#Z5}ng^y4>O@5O-S1xlUBBFAfZhi+9p5)QWX$m3>67BHZ)NfXbIc8V!j#0`#pE}ygt9N z$AtFR@Kw%p&+qxTyXWpbzvsK_ZCyR160MXn5a>s_M1_1>C5U1k2Pvojeg*v63ivswumzbv-3y?c|9dLn z8!F(xs(`;x0e`gu?o`0(@w4#pr(OW%>VJC$d>Z(GGinc~2d?)ZXVkD&@?1)4P$?tntSgHEmPlPs4H=*&tP!?7l1Zf8o%X;G zoH?0HIsF!u(uL@lhTJ7amg<7FGm`ta% zrj3BnlTeH2L(y8$TFiJwUOjm=K%apoJ)6z=xThuXO)y8yt5I0)bm9Y|5j>?D`LFo3 zpyailoab$xFUL<-cH8v4%y?Mi^=e=VF9%Nk08TbMNpEB@;2L7~xFEa4M22Nw6nyL|~MxYvjY6Pkg_&i78?L}vQ6y5#z z`skjzKduxadgqi|TR0ru{Y3pC8J0q82jG0+ymcUpmI=}yB1wMc)k2}LSMu~?k)L_q z;P{^K*}<7oGgfy&g|58u^)Tdpy1H#} z`}JeJeLa(Pr(lFdCl~$z>M;KRmW9T}ShBsd7wpBzL?`Q35xMvSw-H18=$DYk(4JQ~ zvS`^jIX#=foRQB(dR#Lm%zc3+ChEc$WA$K*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ub58-uUPKe*m`BM9*IT z-nT=)sPBW!Ok6J06JTuGi?G&iR+P(OA8f}wohcxU%eTTx(xC0Pv7)Ayk3UJ5uhl&% z+h6D*DnoUpWKwVJDUtje)(*#Y;LZYyI}cv`c>bW@F}d#2Q2&|wvdVP(gj_D`(qraR Qk)nB*Dvi^920m8&8^a)~%m4rY diff --git a/T2/tp/exercice-1/preambule.o b/T2/tp/exercice-1/preambule.o deleted file mode 100644 index c8beb268c63c4f381953928b33ed2eee68ec686f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4520 zcmbuBTWl0n7{^a3ms+tG6h#pnB4SY)I|vHI%a+oziA4~KXf#f?y8|ul&TM99EhP$x zLITkmUW`1L7!w|dzW89gMs2*1;DaxQgm)9uL>{~Z9*jx-{%6j&{r2oGn)oH>_B;RY zoNvyYIcJU!3=J-5X;Ew~>TxySVye{no962oUCpR2)v5mMT>aOcXS36r!M=v4HwD<%OsL+B4#At#1)^+h!|~Kuc*sd2Cz=eMWHfM! zl_WUQu69p`W!c^Z?8L!DkShm;cC{}k=1QYc95|(@oPf*^btp(u-!hA&KFN&-A<0MM zAXjjLumI-=OVlckR3-wSoYeD_`B5ndRX_1Whe)v{+NWI|$cEw?5^F6t<937bQI3&ZqXP1xn3;wNirJk`}7v=w8)wq^o7+(j{$YXtou^ z?=*cEP!4o-^>wuE?V!QXx5e~bLYeL8TJTwWM_b>GhSnE&fQ9P!x%wW&g5G*-twvef z*Q%eYmZ8laTD;frQx?~olh*A$i*Gafk1d`t{6~uq8vcvLhYWw);%K(2wmSMW zk!4~(Tri5~sKh?DEh5l}zf8Pa?2{hj_-YgVTTS@;dYnJzI8rV@YNG$L3CD9Zit{Jp z%hY1ZQ`6rQRWDO&r2n}Ize2oQ)yH|YiGCq{a*f9CZo*eJ;i`JRyLsgf_4gw4kZnZv z5VB3kHY0l&*(1odBJ)zUmU~*ig~p2tm3*N5okP2~_YL{G2M6~J4Ew`<+lK~x<@=?0 zEKCmi`O$HuZ!}d(FArb0{D~+(ZlOx3VfETjxPx%H>B=NsIaP+#0~qx9u2}yCAepWICdHbsp*rjF?qC?Fn-X*WRx!@qg7bc`_4knm2K`z}JdOuQ z2EAN|K21}OyNmU^47cNdM(FWBz=HdGtdm4tl3eNw_V6er24a~+kmocX8 z?-(KWk~Bv)sE+Ry(v22pf86iVcz!Mis1x;?Jwk2AJohE(Om%zxGQ=9K-(_54WL;wY zFo(T<`-oxwUP{ug8b7|bxR2xJ@&)SPI%`m_u@}^I+S&=?ODLJ?j7q5<3uZO-9n{Ew1p+2}GcBsQ?f(z%ApckZ diff --git a/T2/tp/exercice-1/sensorManager.o b/T2/tp/exercice-1/sensorManager.o new file mode 100644 index 0000000000000000000000000000000000000000..4feb60f6c5536f3cd845ea4b9f81599b4d3774ab GIT binary patch literal 1608 zcmbtUPiqrV5TDIP8?|mz@er-(9z+!EBU|dh9wbS-Nt9@zO-@q6CS4P-*@WG<(0cF> z5g`=8i{QubBM23|_N-sPgBKAmD%6?X_nOUSPdf0JncvKB=4Iw>o|(0BN>MvROPQ z@Khc&AO-M&FnPW6Xp<;UHbB|UDhsnSnK#(%Dq@#{2*4U?Q_H?et!cTTTGn(|%N4b3 zQOk&oX+<+h!}p`<2=z{y7~%3(lPop(6_XfwDg@J;3aBtMg@yUa_f>=GOj732Jr}uW zFayLc;-PuQC67Q74xa6JefPfQSRLDCZRptit~2mCG%L0BQnA)tFPAsXdb3_E)yyWi zma|Q@FNg+d)MxPgISNG=IPQ^lITq&a^|;jn=5aUFU1_=Yj>WjW%YkiM+yd6}JYem9 zuV*`mIel(3d>e}%x7v?|-*J34aQg$><$J(_3U;^o$hCU*xaWUZI&$e1#5Y(#j6}{m z^rmOKfB~9KK_&>@6+_7h|1@gqBR4PcYXXnIxR-(#SMe8nQ`G!dz9IV4yNQbIPxYfB z`%AroL1{