Linux Today: Linux News On Internet Time.





More on LinuxToday


Handling Semaphores in C Programs

Jun 02, 2009, 09:03 (6 Talkback[s])
(Other stories by Jim Sansing)

WEBINAR:
On-Demand

Full Text Search: The Key to Better Natural Language Queries for NoSQL in Node.js


[ Thanks to JJS for this link. ]

"What I have found in programming books, including those by the late W. Richard Stevens (which I turn to most often) is usually a good start, but never the whole story. But since this is not a general programming text, I will focus on a single issue in detail. This post will cover using semaphores.

"First, a little background on locks, in case you have never used them. In *nix, process locks are implemented with the semaphore system calls. Since I use child processes that share memory, I have to implement semaphores. Threads use pthread_mutex calls, which do essentially what these functions do, and then some."

Complete Story

Related Stories: