• Home
  • Popular Downloads
  • Contact Us
  • Submit

Softpile

Free Downloads

Main Navigation
  • Home
  • Windows
  • Mac OS X
  • Business
  • Desktop
  • Development
  • Education
  • Games
  • Internet
  • Multimedia
  • Utilities
Home » Linux » Pipe-Sem

Pipe-Sem

April 8, 2008
Pipe-Sem - Pollable Semaphores implementation for Unix systems.
Version: 1.0
License: GPL
Operating System: Linux
Homepage: www.xmailserver.org
Developed by: Davide Libenzi
Pipe-Sem - Pollable Semaphores implementation for Unix systems.

When developing ASYNC applications, I often had the need for locking primitives that could be fed inside a pollable device like select, poll or epoll. Many syncronization primitives are available for Unix systems, but any of them expose a pollable interface to the user. In these cases, if the caller execute a down operation on a blocking semaphore, the application will sleep and whole ASYNC loop will starve because of the wait. To cope with this problem in my ASYNC software, I developed a pipe based semaphore implementation, that I called Pipe-Sem.

The implementation is trivially simple and it uses the pipe internal mechanisms to expose a pollable wait interface. Besides the standard semaphore operations, the function psem_down_fd() can be used to retrieve a files descriptor that can be dropped inside a Unix pollable API like select(2), poll(2) or epoll(2). The caller will have to wait for input events (POLLIN), and when receiving the event itself, the caller should invoke the psem_try_down() function to try to acquire the semaphore. Note that receiving an event from the pollable interface, does not mean that we acquired to semaphore, and the function psem_try_down() will have to be called (and tested for zero return code) to correctly complete the down operation
implementation pollable pollable semaphores semaphores semaphores implementation unix utility
Free Download 100% Secure
0
  • Share on:

Sponsored

Categories

  • Linux

Related Downloads

GEDXchange
GEDXchange is a collection of genealogy tools to work with GEDCOM 5.5 and GSF ...
nss-mdns
nss-mdns is a plugin for the GNU Name Service Switch (NSS).
KPorts
A frontend to Ports and PkgSrc, packaging systems most commonly used on the ...
LFWrap
LFWrap is an executable wrapper for creating DreamWeaver style lock files for ...
Corsis
Corsis is an open-source, multi-platform project initiated to equal and excel ...
Copyright © 1999-2017 Softpile Free Downloads
  • Contact Us
  • Submit
  • Privacy Policy
  • Disclaimer
  • Terms of Use