Showing posts from March, 2017

Semaphore exemple

this is an exemple in C, to use thread:
//progamme prod_cons.c #include <semaphore.h> #include <unistd.h> //pour sleep #include <pthread.h> #include <stdio.h> #define N 3 sem_t occupe, libre ; int tampon[N]; void* consommateur(void *); void* producteur(void *); int main()  {pthread_t th1,th2; sem_init(&occupe,0,0); // initialiser les sémphores sem_init(&libre,0,N); pthread_create(&th1, NULL,consommateur ,NULL); //cree les threads pthread_create(&th2,NULL,producteur,NULL); pthread_join(th1,NULL); // attendre la fin des threads pthread_join(th2,NULL);       printf("ici main, fin des threads \n"); return 0; } void* producteur(void *depot) {int ip=0, nbprod=0, objet=0; do { sem_wait(&libre); // produire tampon[ip]=objet; sem_post(&occupe); printf("\n ici prod. : tampon[%d]= %d\n", ip,objet); objet++;        nbprod++; ip=(ip+1)%N;         }  while ( nbprod<=30 ); pthread_exit(NULL); } void* consommateur(void *retrait) { int ic=0, nbcon…

Progest System

Try our new application version Béta:

it's a Simple application to manage a project ,  create modules, Tasks, affect ressources.. 

url : Login : user Password: user

there is some functionnlity not available. 
it's will be available in the next version soon 
Thanks for your comments. 

PropretyBag with JavaScript in SharePoint 2013

as we know, Property bag are very important in SharePoint development, and to get it with JavaScript is very simple :

//wait until client object model dependencies are loaded before executing our code ExecuteOrDelayUntilScriptLoaded(getWebProperties, "sp.js"); varwebProperties;