Sponsored Content
Top Forums Programming List of suspended tasks on a semaphore/message queue Post 302260959 by taklubaba on Saturday 22nd of November 2008 10:54:53 AM
Old 11-22-2008
List of suspended tasks on a semaphore/message queue

Hi,
I have created a posix semaphore.
Is it possible to have a functionality, wherein I can reset the semaphore.
ie All the tasks waiting for the semaphore will be signalled and will return with error values and the semaphore value will be set to its initial value.
Is there a way to get a list of the tasks that are waiting for the posix semaphore and then send signals to them?

Likewise, is there a way to clear a message queue created using the System V Call, of all its messages and signal to tasks waiting on that queue to return back?

Please provide some solutions.
Thanks.
Taklu.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Unix message Queue

Hi, I am working closly with unix message queues i have encountered the following - after creating the Q and start working with it (pushing & pulling) i receive the following stange parameters on the q's - STIME=no_entry Qnum=0 CBYTES=4140 when this happens, the Q is disabled (meaning i... (3 Replies)
Discussion started by: kel
3 Replies

2. Programming

a message queue question..

Hi there: Thanks first. When I use a message queue amony severl processes, will I have to synchronize the queue? I don't think I would have to because a message queue is implemented in a link listed. Correct me If I am wrong... (0 Replies)
Discussion started by: yanhu
0 Replies

3. Programming

Message Queue Problem Again..

Is there any way one can delete , say , a particular message from a message queue on system V? (2 Replies)
Discussion started by: satansfury
2 Replies

4. Programming

message queue

Hello, i need to write a message queue "chat server", that should work only localy. Can anyone please help me with some ideas and peshaps code. I'm studying the UNIX IPC mechanisms right now. So far, i understand how it works but i still cannot get an idea how to write a chat programm... ... (2 Replies)
Discussion started by: etenv
2 Replies

5. Programming

How to limit max no of message in a posix message queue

Hii can anyone pls tell how to limit the max no of message in a posix message queue. I have made changes in proc/sys/fs/mqueue/msg_max But still whenever i try to read the value of max. message in the queue using attr.mq_curmsgs (where struct mq_attr attr) its giving the default value as 10.... (0 Replies)
Discussion started by: mohit3884
0 Replies

6. Programming

Message Queue Problem

Hi all, I need help about message queues, i have a server-client program that communicates each other via msg queue, firstly server opens its msg queue and waits for msg then client opens server msg queue and its own msg queue(for receiving msg from server,clients sends msg to server msg... (7 Replies)
Discussion started by: SaTYR
7 Replies

7. Programming

UNIX Message Queue

Hello !!!!! I have a simple question but i can't find the answer anywhere hope to meet it here. Why it is a bad idea to pass pointers through message queues ? Most structs i see all of their char types are arrays... Is it becase having pointers means we could possibily send wrong bytes ? For... (2 Replies)
Discussion started by: qlyine
2 Replies

8. Ubuntu

Message Queue in Linux

Hello How can I see the created message queues in the system? (4 Replies)
Discussion started by: xyzt
4 Replies

9. Filesystems, Disks and Memory

DISK ARRAY PROTECTION SUSPENDED message displayed following disk replacement

Hello, On 4/20/2018, we performed a disk replacement on our IBM 8202 P7 server. After the disk was rebuilt, the SAS Disk Array sissas0 showed a status of degraded. However, the pdisks in the array all show a status of active. We did see a message in errpt. DISK ARRAY PROTECTION SUSPENDED. ... (1 Reply)
Discussion started by: terrya
1 Replies

10. AIX

DISK ARRAY PROTECTION SUSPENDED message following disk replacement

Hello, On 4/20/2018, we performed a disk replacement on our IBM 8202 P7 server. After the disk was rebuilt, the SAS Disk Array sissas0 showed a status of degraded. However, the pdisks in the array all show a status of active. We did see a message in errpt. DISK ARRAY PROTECTION SUSPENDED. ... (3 Replies)
Discussion started by: terrya
3 Replies
sem_unlink(3)						     Library Functions Manual						     sem_unlink(3)

NAME
sem_unlink - Removes the specified named semaphore (P1003.1b) LIBRARY
Realtime Library (librt.so, librt.a) SYNOPSIS
#include <semaphore.h> int sem_unlink ( const char *name) ; PARAMETERS
*name Specifies the name of the semaphore to remove. DESCRIPTION
The sem_unlink function removes a semaphore named by the string name. If the semaphore is referenced by other processes, sem_unlink does not change the state of the semaphore. If other processes have the semaphore open when sem_unlink is called, the semaphore is not destroyed until all references to the semaphore have been destroyed by calls to sem_close. The sem_unlink function returns immediately; it does not wait until all references have been destroyed. Calls to sem_open to recreate or reconnect to the semaphore refer to a new semaphore after sem_unlink is called. RETURN VALUES
On a successful call, a value of 0 (zero) is returned. Otherwise, a value of -1 is returned and errno is set to indicate that an error occurred. ERRORS
The sem_unlink function fails under the following conditions: [EACCES] Permission is denied to unlink the named semaphore. [ENAMETOOLONG] The length of the name string exceeds {NAME_MAX} while {_POSIX_NO_TRUNC} is in effect. [ENOENT] The named semaphore does not exist. RELATED INFORMATION
Functions: sem_close(3), sem_open(3) Guide to Realtime Programming delim off sem_unlink(3)
All times are GMT -4. The time now is 08:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy