- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: semop() hanging forever on HP-UX 11.23 itanium
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2009 01:22 AM
тАО11-09-2009 01:22 AM
The semop() call is hanging forever in my code. Please find the code below.
Can anyone make out what's wrong? The same code works well on PA-RISC systems with HP-UX 11.11.
if (!getWriteLock())
{
OSCMon().outputAlarm(SIAALRMRTGTBLERR,
ALARMCRITICAL,
"Error in NpaNxxRTWriter::update: semaphore failure.");
throw exception("Error in NpaNxxRTWriter::update -> semaphore failure.");
}
---------------------------------------------
bool NpaNxxRT::getWriteLock()
{
OSCMon().debugMsg("",
OSCMONTRACEMSGLOWPRIORITY,
"NpaNxxRT: getWriteLock: lock semaphore\n");
struct sembuf sop;
sop.sem_num = 0; // the write lock is the first one
sop.sem_op = -1; // locked
sop.sem_flg = SEM_UNDO; // in case I die
cout << "Before semop" << endl;
int temp = semop(_semid, &sop, 1);
cout << "After semop=" << temp << endl;
return semop(_semid, &sop, 1) == 0;
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2009 01:51 AM
тАО11-09-2009 01:51 AM
Re: semop() hanging forever on HP-UX 11.23 itanium
Perhaps you want: return temp >= 0;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2009 01:54 AM
тАО11-09-2009 01:54 AM
Re: semop() hanging forever on HP-UX 11.23 itanium
I added first semop() for debugging purposes... Plz ignore.. The actual code is
bool NpaNxxRT::getWriteLock()
{
OSCMon().debugMsg("",
OSCMONTRACEMSGLOWPRIORITY,
"NpaNxxRT: getWriteLock: lock semaphore\n");
struct sembuf sop;
sop.sem_num = 0; // the write lock is the first one
sop.sem_op = -1; // locked
sop.sem_flg = SEM_UNDO; // in case I die
return semop(_semid, &sop, 1) == 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2009 01:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2009 02:39 AM
тАО11-09-2009 02:39 AM
Re: semop() hanging forever on HP-UX 11.23 itanium
if (semid > 0)
{
semctl(semid, 0, SETVAL, 1); // start out unlocked
semctl(semid, 1, SETVAL, 0); // shared mem not set
return semid;
}
We are not using the semun union.. Is that causing the issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2009 02:41 AM
тАО11-09-2009 02:41 AM
Re: semop() hanging forever on HP-UX 11.23 itanium
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2009 04:29 AM
тАО11-09-2009 04:29 AM
Re: semop() hanging forever on HP-UX 11.23 itanium
Exactly, you must use that union. The IPF calling conventions require strict adherence to what's documented.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2009 09:27 PM
тАО11-09-2009 09:27 PM
Re: semop() hanging forever on HP-UX 11.23 itanium
Thanks,
Goutham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2009 09:28 PM
тАО11-09-2009 09:28 PM