This should roughly do the job:
Not the most efficient, since it needs 4n+1 semaphore operations to deal with n threads though... And it has race conditions where threads might not sleep if they try to wait when other threads are in the process of being woken up.
Beyond that I'm not sure there's a portable way to do what you want. This is what pthreads is supposed to be for.
Dear Srs,
I'm getting this error on a Linux box, running Apache 2.0.52:
"host: isc_taskmgr_create: no available threads"
Making some search for those strings in Google, didn't tell me anything about this.. appears to be related to SELinux, but it's disabled in the box.
Any idea about... (0 Replies)
hi,
I have
* an IBM P550 machine,
* an AIX 5.3 running on it and
* an oracle database, already installed on it.
The problem (or question of my own) is:
Oracle tns listener, "CT_LISTENER", and the enterprise manager (EM) of the instance, which is uniq instance and called... (0 Replies)
hi,
I have a problem about the Oracle related components. I'm not able to find any answer yet, and waiting for your responses...
Here is the configuration of my system:
* an IBM P550 machine,
* an AIX 5.3 running on it and
* an oracle database, already installed on it.
The problem (or... (1 Reply)
Rebuilding a server (T2000) from a flash archive I created on another server. Using a Solaris 10/08 DVD to boot from the was going to point it tot he flash archive and pull it over NFS. I've done this many times with success until now.
It initially boots off the DVD, you input the... (5 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Well, my first post... thanks in advance! Can applications be notified of the X Window close (with "X" button) so the signal handler can run a cleanup process method?
About the app: built with GNU C/C++ on Solaris 10, with WxWidgets. It is launched by a shell script as a background task. The... (2 Replies)
I get an error after the initializing screen. I am using a DVD/ROM to boot up the installation on a Dell Inspiron 1520. Segmentation fault - core dumped. I have tried to restart multiple times. Please help (1 Reply)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT MINIX
sem_post
SEM_POST(3) Linux Programmer's Manual SEM_POST(3)NAME
sem_post - unlock a semaphore
SYNOPSIS
#include <semaphore.h>
int sem_post(sem_t *sem);
Link with -pthread.
DESCRIPTION
sem_post() increments (unlocks) the semaphore pointed to by sem. If the semaphore's value consequently becomes greater than zero, then
another process or thread blocked in a sem_wait(3) call will be woken up and proceed to lock the semaphore.
RETURN VALUE
sem_post() returns 0 on success; on error, the value of the semaphore is left unchanged, -1 is returned, and errno is set to indicate the
error.
ERRORS
EINVAL sem is not a valid semaphore.
EOVERFLOW
The maximum allowable value for a semaphore would be exceeded.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+-----------+---------------+---------+
|Interface | Attribute | Value |
+-----------+---------------+---------+
|sem_post() | Thread safety | MT-Safe |
+-----------+---------------+---------+
CONFORMING TO
POSIX.1-2001.
NOTES
sem_post() is async-signal-safe: it may be safely called within a signal handler.
EXAMPLE
See sem_wait(3).
SEE ALSO sem_getvalue(3), sem_wait(3), sem_overview(7), signal-safety(7)COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
Linux 2017-03-13 SEM_POST(3)