02-10-2010
Unfortunately sem_post doesn't support multiple posts at once. SYSV IPC sems do, I believe, but they may have higher overhead. You might also check out 'man pthread_cond_init'. A condition variable isn't quite a semaphore, but does support launching multiple threads with one signal.
10 More Discussions You Might Find Interesting
1. Programming
Hi,
I am trying to write stuff to a shared memory using a writer, and reading the corresponding stuff using a reader. I am facing problems while releasing the lock, as a result of which I am having segmentation faults. The code is as follows...
/********** writer.c ***********/
... (1 Reply)
Discussion started by: jacques83
1 Replies
2. Programming
Hi,
does anybody know, if it is possible to replace mutex with POSIX semaphore?
I'm gonna to rewrite old thread's program with processes and I don't want rewrite most of the code...So if I replace the threads with processes and mutexes with semaphores WILL IT WORK?
Before, the critical... (1 Reply)
Discussion started by: michael26100
1 Replies
3. Solaris
Hi,
One of my prod jobs using Ab Initio (which is Solaris Based) returned this error:
========= Error from Reformat_3.000 on f7j21-01.xxxx3.com ========= Failed opening file for flow: Resource temporarily unavailable
Flow = "Flow_11.000" connected to output port "out0" of "Reformat_3.000"... (0 Replies)
Discussion started by: teenu18
0 Replies
4. Linux
Hi all
i am facing a problem with ext3 file system
df -h is showing 19gb is used even if there is not a single file on the mount point
/dev/mapper/vg01-archive
55G 19G 33G 36% /archive_log
OS == Linux cdrsvr 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007... (1 Reply)
Discussion started by: ajays
1 Replies
5. Filesystems, Disks and Memory
I have a volume managed by Veritas Storage Migrator 6.0 running on Solaris 10. It has one managed volume and one tape robot it shares with netpackup (separate volume pools). When I check the process tree I am not seeing any migration processes running, but when I check the panel on the tape robot... (0 Replies)
Discussion started by: ilikecows
0 Replies
6. Solaris
Hi Guys !
I have found this problem many times that the swap space (/tmp space more precisely )of my Server becomes full specially when i run a complete back up of the server .
once the /tmp space is full I am not able to run simple commands as i get error like :
fork no space
on... (6 Replies)
Discussion started by: Paarth
6 Replies
7. Solaris
Hi Guys !
I have found this problem many times that the swap space (/tmp space more precisely )of my Server becomes full specially when i run a complete back up of the server .
once the /tmp space is full I am not able to run simple commands as i get error like :
fork no space
on... (4 Replies)
Discussion started by: Paarth
4 Replies
8. AIX
Hey Guys,
I need a help,
After I upgraded my server to AIX 6.1.4 the port 80 is occupied by a Java process
bash-3.00# netstat -Aan | grep "*.80"
f1000700007d7bb0 tcp 0 0 *.80 *.* LISTEN
bash-3.00# rmsock f1000700007d7bb0 tcp
usage: rmsock Addr... (2 Replies)
Discussion started by: kkeng808
2 Replies
9. AIX
Hi everyone,
i have a question about the Memory Management in AIX 6.1.
I have
- 128 GB RAM and
- 70 GB Page Space.
The application i am running on this machine is doing some operations in perl. These are done only once a day and uses both memory and paging space. My problem... (1 Reply)
Discussion started by: Haichao
1 Replies
10. UNIX for Beginners Questions & Answers
Hi all,
I would greatly appreciate some help with this. I may not even be on the right path but I think I am close.
I have a Synology NAS that I am running rsync jobs on to offload to USB3. These work fine.
I have backup software on our Windows Server 2008R2 that I have now realized can... (2 Replies)
Discussion started by: stefshuuj
2 Replies
LEARN ABOUT HPUX
sem_post
sem_post(2) System Calls Manual sem_post(2)
NAME
sem_post - unlock a POSIX semaphore
SYNOPSIS
DESCRIPTION
is used to post the semaphore referenced by sem. The calling thread will not return from its call to unless it can either: increment the
semaphore value, if there are no blocked threads on this semaphore; give the semaphore to a blocked thread, if there are any blocked
threads on this semaphore; or have an error condition.
If the semaphore value is < 0, the semaphore has blocked threads, waiting for it to become available (the absolute value of the semaphore's
value indicates the number of waiters at that moment). If the semaphore value is >= 0, the semaphore has no waiters.
If the semaphore has no waiters at the time its value is checked, the semaphore's value will be atomically incremented, with respect to the
checking of its value, up to its maximum value as specified by If the semaphore has waiters at the time its value is checked, the semaphore
value is not changed. Instead, the calling thread will attempt to wake up a waiter. If the semaphore has waiters having realtime priori-
ties, the thread must wake up the highest priority waiter. Otherwise the thread at the head of the channel queue is woken up.
When a waiter is successfully woken, the semaphore being posted will be given to the woken waiter. In other words, the state of the sema-
phore remains unchanged. Instead, the semaphore being posted will be inherited by the waiter being woken from this call to
If the specified semaphore referred to by sem is a named semaphore, then this semaphore must have been opened by the calling process with
The calling process must have both read and write permissions on the semaphore to perform this operation. The routine may be called asyn-
chronously, i.e. from a signal handler.
To use this function, link in the realtime library by specifying on the compiler or linker command line.
EXAMPLES
The following call to will post the semaphore sem.
RETURN VALUE
A successful call to will return 0 and the calling thread would have posted the semaphore. Otherwise, the call to will return -1 with
errno set to the appropriate value of the error condition.
ERRORS
fails and does not perform the requested operation if any of the following conditions are encountered:
[EPERM] The calling process does not have the privileges necessary to post the semaphore.
[EINVAL] The argument sem does not refer to a valid semaphore.
SEE ALSO
<semaphore.h>.
STANDARDS CONFORMANCE
sem_post(2)