The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
semaphore raguramtgr UNIX for Dummies Questions & Answers 7 06-15-2009 10:39 AM
Semaphore Jaken Shell Programming and Scripting 2 04-04-2009 06:10 PM
Semaphore problem.... Dreams in Blue UNIX for Advanced & Expert Users 1 05-29-2008 01:41 AM
Semaphore debugging ptprabu High Level Programming 5 11-28-2007 04:09 PM
semaphore yls177 UNIX for Dummies Questions & Answers 1 10-09-2002 12:18 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-07-2003
vjsony vjsony is offline
Registered User
  
 

Join Date: Jul 2002
Posts: 11
Semaphore

Hi,

I'm new to UNIX.
I need to know what's a semaphore

Do reply.

Thanks
VJ
  #2 (permalink)  
Old 04-07-2003
norsk hedensk norsk hedensk is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2002
Location: new york
Posts: 1,025
try this:
man -k semaphore
  #3 (permalink)  
Old 04-07-2003
oombera's Avatar
oombera oombera is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
The way I understand it (someone correct me if this is wrong), when you've got a certain shared resource that, for one reason or another, can only be accessed by one process at a time, you'd use a semaphore.

Basically, the semaphore is a variable that keeps track of all the processes that currently want to access the shared resource and it makes sure only one process at a time actually accesses it.

Read these for more info:

http://www.ecst.csuchico.edu/~beej/g...emaphores.html
http://www.cs.cf.ac.uk/Dave/C/node26.html
http://metalink.oracle.com/cgi-bin/c...e_cr.cgi?20766
http://www.cim.mcgill.ca/~franco/OpS...es/node30.html
http://www.acm.uiuc.edu/lug/presenta...m-5.html#ss5.5
  #4 (permalink)  
Old 04-07-2003
Neo's Avatar
Neo Neo is online now Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,799
A semaphore is a flag used to insure than events are atomic. . Just like a railroad semaphore, the flag provides a signal to one train if another is approaching, helping the conductors of the train avoid a train wreck.

The same is true for software processes that share memory, files, or other software artifacts. A semaphore is used in interprocess communications to insure that there are no 'train wrecks' between software processes.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:41 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0