Sare
From Wikipedia, the free encyclopedia
- SARE can also mean Sustainable agriculture research and education, a part of the USDA that promotes sustainable agriculture.
Location | |
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. | |
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
- Alberto Palacio, Spanish engineer.
[edit] External links
|
- include <sys/types.h>
- include <sys/stat.h>
- include <sys/ipc.h>
- include <sys/sem.h>
- include <fcntl.h>
- define MUTEX 0
- define FIRST 1
- 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); } }
}