- Examples
Pour libérer un sémaphore, vous appelez la commande CLEAR SEMAPHORE. | To release a semaphore, you call the CLEAR SEMAPHORE command. |
Le sémaphore peut maintenant être utilisé avec la fonction semop(2) | The semaphore can now be used through the function semop(2) |
Pour libérer un sémaphore, vous appelez la commande EFFACER SEMAPHORE. | To release a semaphore, you call the CLEAR SEMAPHORE command. |
La fonction qui crée un sémaphore se nomme semget(2) | The function that creates a semaphore is semget(2) |
Seul le process qui a posé le sémaphore peut le libérer. | Only the process that sets the semaphore can remove it. |
Le sémaphore local évitera ces effets indésirables. Exemple 1 | Using a local semaphore would avoid these undesirable side effects. |
Nous avons besoins d'un sémaphore pour plusieurs raisons. | We need this semaphore for several reasons. |
Un sémaphore binaire protège l'accès au hardware par les tâches temps réel. | A binary semaphore protects the access of the hardware by real time tasks. |
Le sémaphore local évitera ces effets indésirables. | Using a local semaphore would avoid these undesirable side effects. |
Le processus est en sommeil jusqu'à ce que la valeur du sémaphore atteigne 0. | The process sleeps until the value of the semaphore reaches 0. |
Un sémaphore global est visible par tous les utilisateurs et tous les process. | A global semaphore is accessible to all users and all their processes. |
Un sémaphore non libéré peut provoquer le blocage d'une partie de la base. | A semaphore that is not released can block part of the database. |
Ainsi, le premier process demandant un sémaphore sera le premier à l'obtenir. | This way, the first process requesting a semaphore will be the first to get one. |
Un seul sémaphore ne peut pas gérer les deux situations, puisque semop n'agit que dans un sens. | A single semaphore cannot manage both situations, because semop acts one-way. |
L'exemple suivant illustre l'utilisation d'un sémaphore local. | The following example uses a local semaphore. |
Poser et libérer le sémaphore au sein de la même méthode permet pratiquement d'éliminer ce risque. | Setting and releasing semaphores in the same method helps to eliminate this risk. |
Chaque méthode exécutée par un utilisateur peut tester la présence d'un sémaphore. | The methods that each user is running can test for the existence of a semaphore. |
GETALL Renvoyer la valeur semval de chaque sémaphore de l'ensemble dans le tableau arg.array. | Return semval (i.e., the current value) for all semaphores of the set into arg.array. |
Renvoyer la valeur semval (c'est-à-dire la valeur courante) de chaque sémaphore de l'ensemble dans le tableau arg.array. | Return semval (i.e., the current value) for all semaphores of the set into arg.array. |
La commande Test semaphore permet de savoir si un sémaphore est déjà attribué ou non. | You can use the Test semaphore command to find out whether a semaphore is already assigned or not. |
Random Word
Roll the dice and learn a new word now!
