Need a Posix semaphore timeout system

Need a Posix semaphore timeout system

Post by Olivier Re » Wed, 02 Feb 2000 04:00:00



Hi all,

I work under HP-UX and Solaris with POSIX semaphores. I need an
unexisting API like "sem_wait" with a timeout. In fact, the "sem_wait"
and "sem_trywait" APIs are not sufficient because I would like my
processes to be blocked until a certain amount of time is passed. And I
see no timeout management in the POSIX APIs.

Am I bound to use a timer by calling "create_timer" and to manage the
send of a signal to the blocked process in order to exit the "sem_wait"
? And if such a procedure is mandatory, is somenone can show me quickly
how to handle the signal (or the correct manual entry) ?

Thanx for all,

O. Rey

 
 
 

Need a Posix semaphore timeout system

Post by Geoff Clar » Sat, 05 Feb 2000 04:00:00



>I work under HP-UX and Solaris with POSIX semaphores. I need an
>unexisting API like "sem_wait" with a timeout. In fact, the "sem_wait"
>and "sem_trywait" APIs are not sufficient because I would like my
>processes to be blocked until a certain amount of time is passed. And I
>see no timeout management in the POSIX APIs.

There is a sem_timedwait() function in POSIX.1d ("Additional Realtime
Extensions").  I don't suppose it's available on many systems yet.

--



 
 
 

1. Sys V Semaphores vs. POSIX Semaphores??

We have a need for a very "fast" hardware locking mechanisms for a high
speed OLTP system.  This mechanism must not only be very "fast" (several

thousand locks/unlocks per second), but it should be scale well.  A
typical multi-cpu machine will have about four to six processes
(multi-threaded), all accessing/setting these locks.  We're getting
conflicting stories from about which is faster, System V or POSIX
semaphores under Solaris.  If anyone has crossed this path before, I'd
appreciate any information, if benchmarks have already been done, I'd
appreciate it I can get a copy of the code used during those benchmarks.

Thanks in advance,
Roque Solis
Systems Engineer - The SABRE Group

2. set_multicast_list callback problem.

3. POSIX system call interface and POSIX standard: questions

4. ATAPI and Yggdrasil

5. Re : System V Semaphores (Needs Reply Urgently)

6. Exclude files when searching

7. posix named semaphore value not reflected across process

8. Red Hat 6.1 Install crash on Compaq 1685

9. %!@# Help Posix semaphores & mmap

10. POSIX Namned Semaphore

11. using Posix/SystemV semaphores under Linux RH 6.2

12. POSIX semaphores and Kernel 2.4.7, glibc 2.2.4 (RedHat 7.2)

13. POSIX.4 Semaphore questions