The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

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 09:39 AM
Semaphore problem.... Dreams in Blue UNIX for Advanced & Expert Users 1 05-29-2008 12:41 AM
Semaphore debugging ptprabu High Level Programming 5 11-28-2007 04:09 PM
Semaphore vjsony UNIX for Dummies Questions & Answers 3 04-07-2003 02:06 PM
semaphore yls177 UNIX for Dummies Questions & Answers 1 10-08-2002 11:18 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-06-2007
Jaken Jaken is offline
Registered User
  
 

Join Date: May 2006
Posts: 17
Semaphore

Hi,

I am looking to use a semaphore for the first time in one of my scripts. I am just wondering if there are any simple examples or tutorials around?

I am a beginner so the simpler the better

Thanks

-Jaken
  #2 (permalink)  
Old 05-07-2007
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
Shell scripts do not have a per se semaphore facility. There are several ways to communicate with other scripts, mostly via files. Languages like perl do have semaphores.
  #3 (permalink)  
Old 04-04-2009
rouilj rouilj is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 2
Thumbs up

I managed to grab a semaphore implementation in ksh originally written by
Ed Schaefer and John Spurgeon for UNIX Review in 2004. The original has dissappeared but my slightly fixed copy is available at:

http://www.cs.umb.edu/~rouilj/#Semaphore

In addition to per user seamphores it also supports a queing mechanism to help prevent starvation.

The only current issue with it is that it works only on a single machine,
I have a plan on how to make it work across multiple machines, but that's not implemented yet.

-- rouilj
Sponsored Links
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 01:16 AM.


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