: Semaphore with Timeout?

: Semaphore with Timeout?

Post by Ed Evan » Tue, 27 Jun 1995 04:00:00



Hi, all.  I've looked around for a way to do something along the lines of
setting a semaphore, but having it "expire" after some predetermined length of
time.  Basically, I use it to control access to a resource, but I don't want to
wait forever.

My constraints are:

1) I don't want to use another process to monitor / wake me up.
2) I don't want to use the alarm because someone else may already be using it.

What are my options?  Do I have any?

Thanks for your help!

Ed

____________________________________________________
Ed Evans  - TRW Information Systems and Services
Orange, California

 
 
 

: Semaphore with Timeout?

Post by Scott Burke » Wed, 28 Jun 1995 04:00:00


:1) I don't want to use another process to monitor / wake me up.

Agreed.  Way too mush overhead for a seemingly simple task.

:2) I don't want to use the alarm because someone else may already be using it.

: What are my options?  Do I have any?

If your system supports POSIX.4, check into using the new real time timer
calls (timer_create(), timer_settime(), etc).  If your system doesn't
support POSIX.4 yet, try looking into the BSD/SVR4
setitimer()/getitimer() calls.  These calls all allow you to use more
than one interval timer in your application.

Regards.

--

Computerpeople/DCI, Inc.         | URL: http://www.wta.com/tblgnuts
St. Petersburg, Florida, USA     | Tampa Bay Linux GNU Technical Society
--

Computerpeople/DCI, Inc.         | URL: http://www.wta.com/tblgnuts
St. Petersburg, Florida, USA     | Tampa Bay Linux GNU Technical Society

 
 
 

1. semaphore timeout

Hello,

Is there a way to specify a time out in msecs, that a semop operation will
last? I.e. I want semop to try for x msecs to get a semaphore, and afterthat
if it wasn;t succesful to exit.

Thanks,
MrZammler

2. newbie , please help.

3. Timeout on semaphores (in kernel context)

4. Can't get into my own directory!

5. 2.5.49 - semaphore operations with timeouts

6. IPv6

7. timeout a semaphore

8. Top tip for improving the popularity of Linux

9. timeout on semaphore

10. timeout requirement for semaphores

11. timeout a semaphore

12. timeout semaphore

13. Need a Posix semaphore timeout system