LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-05-2008, 02:50 AM   #1
harsha
LQ Newbie
 
Registered: Jan 2004
Location: bangalore
Distribution: red-hat
Posts: 1

Rep: Reputation: 0
counting semaphores in user space linux


I am told that linux supports counting semaphores which can be used to construct a binary semaphore. I am aware of the following system calls and their usage.

1. semget ---- to create semaphore set
2. semctl ---- to retrieve/change the semaphore values
3. semop ---- to acquire/release semaphores

however I do not understand how to use this as a counting semaphore. its pretty easy in VxWorks. Counting semaphores are used when we want to acquire and release the semaphore for a known umber of times.
 
Old 08-06-2008, 02:12 AM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
A semaphore is a simple gate. With a gate, you can manage your own counter. From these simple binary semaphores, you build counting semaphores (your question had this backwards).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to share data b/w user space and kernel space nandac Linux - Kernel 1 11-28-2006 11:15 PM
timers is user space in linux gooner Programming 0 06-07-2004 04:52 AM
Can that be an error in space counting?! ivanatora Linux - General 1 01-13-2004 07:18 PM


All times are GMT -5. The time now is 08:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration