Sare

From Wikipedia, the free encyclopedia

SARE can also mean Sustainable agriculture research and education, a part of the USDA that promotes sustainable agriculture.

Coordinates: 43°18′49″N 1°34′45″W / 43.3136111111, -1.57916666667

Commune of Sare

View of the village of Sare

Location
Sare (France)
Sare
Administration
Country France
Region Aquitaine
Department Pyrénées-Atlantiques
Arrondissement Bayonne
Canton Espelette
Intercommunality Communauté de communes du Sud Pays Basque
Mayor Jean Aniotzbehere
(2001-2008)
Statistics
Elevation 27 m–881 m
(avg. 77 m)
Land area¹ 51.34 km²
Population²
(1999)
2,184
 - Density 43/km² (1999)
Miscellaneous
INSEE/Postal code 64504/ 64310
1 French Land Register data, which excludes lakes, ponds, glaciers > 1 km² (0.386 sq mi or 247 acres) and river estuaries.
2 Population sans doubles comptes: residents of multiple communes (e.g. students and military personnel) only counted once.
France

Sare (Basque Sara) is a small village in the traditional Basque province of Labourd, now a commune in the Pyrénées-Atlantiques département of southern France.

[edit] People from Sare

[edit] External links

Wikimedia Commons has media related to:
  1. include <sys/types.h>
  2. include <sys/stat.h>
  3. include <sys/ipc.h>
  4. include <sys/sem.h>
  5. include <fcntl.h>
  1. define MUTEX 0
  2. define FIRST 1
  3. define SECOND 2


int *counter;

void P(int semId, int semNr) {

   struct sembuf op = {semNr, -1, 0};
   semop(semId, &op, 1);

}

void V(int semId, int semNr) {

   struct sembuf op = {semNr, +1, 0};
   semop(semId, &op, 1);

}


int main(int argc, char **argv) { int semId, pid, shmId;

shmId = shmget(IPC_PRIVATE, sizeof(int), IPC_CREAT | 0600);

if (shmId < 0) { perror("Eroare creare shm"); exit(2); }

counter = (int*) shmat(shmId, 0, 0);

semId = semget(IPC_PRIVATE, 3, IPC_CREAT | 0600);

if (semId < 0) { perror("Eroare creare sem"); exit(2); }

semctl(semId, FIRST, SETVAL, 1);

pid = fork();

while (1) { if (pid == 0) //we are in the son { P(semId, FIRST);

*counter =*counter +1; printf("second counter is: %d\n", *counter);

V(semId, FIRST); sleep(1); } else //we are in the parent { P(semId, FIRST);

*counter =*counter +1; printf("first counter is: %d\n", *counter);

V(semId, FIRST); sleep(1); } }

}