GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Regarding HPUX10.2
Operating System - HP-UX
1847253
Members
4015
Online
110263
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
09-13-2000 10:55 PM
09-13-2000 10:55 PM
Regarding HPUX10.2
Observation - Execution of 'system()' system call after the 'accept()' system call results in
the blocking of threads existing in that process on executing another 'accept()' call.
Detailed Explanation -
The RemoteServer('server' executable) is started. The RemoteServer accepts connections from a client. When the RemoteServer accepts a connection for the first time, a parallel thread is started which isan infinite loop. After starting the thread, a "system()" function is executed.The next connection request by the client results in the thread in the RemoteServer getting blocked.
Other Operating systems like HPUX 11.0,Sun Solaris 2.6 and Aix4.2 do not block the
thread after any number of connections.
However, removing the "system()" function from the code on HPUX10.2 allows further
connections without blocking or killing the thread.
Note : We use cma library to compile the RemoteServer code to support pthread_create call in
HPUX10.2 (ie. we compile the code using the -lcma option).
Query -
1) Is there a relation between the "accept" system call and the "system" system call which
results in any thread existing in that process from getting blocked or killed ?
2) Is the above phenomenon because of the usage of cma library to support pthread_create ?
3) Do we have to use any particular value for the attribute parameter in the pthread_create
call ? (We use pthread_attr_default in our pthread_create call.)
Note : Please refer to file ServerCode.doc for diagramatic explanation
of problem area in code.
the blocking of threads existing in that process on executing another 'accept()' call.
Detailed Explanation -
The RemoteServer('server' executable) is started. The RemoteServer accepts connections from a client. When the RemoteServer accepts a connection for the first time, a parallel thread is started which isan infinite loop. After starting the thread, a "system()" function is executed.The next connection request by the client results in the thread in the RemoteServer getting blocked.
Other Operating systems like HPUX 11.0,Sun Solaris 2.6 and Aix4.2 do not block the
thread after any number of connections.
However, removing the "system()" function from the code on HPUX10.2 allows further
connections without blocking or killing the thread.
Note : We use cma library to compile the RemoteServer code to support pthread_create call in
HPUX10.2 (ie. we compile the code using the -lcma option).
Query -
1) Is there a relation between the "accept" system call and the "system" system call which
results in any thread existing in that process from getting blocked or killed ?
2) Is the above phenomenon because of the usage of cma library to support pthread_create ?
3) Do we have to use any particular value for the attribute parameter in the pthread_create
call ? (We use pthread_attr_default in our pthread_create call.)
Note : Please refer to file ServerCode.doc for diagramatic explanation
of problem area in code.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2000 07:43 AM
09-15-2000 07:43 AM
Re: Regarding HPUX10.2
I found the following information extracted from an earlier call, but I am not sure if it is exactly your situation. Worth reviewing anyway:
"
There is a documented workaround for an accept()/system() call problem.
It is to use an fcntl call to set the close-on-exec flag before calling exec() (which select() is a thin wrapper for anyway; fork/exec/wait). This is documented in "Programming with Threads on HP-UX" in section 3.2.1.6 on page 3-16.
The other option would be to avoid using the select call and calling exec directly
rather than the exec wrapper, also documented in the same section.
The fcntl can be used soon after the socket is created.
.......
sock = socket(AF_INET,SOCK_STREAM, 0);
if (sock == -1) {
fprintf(stderr, "socket failed, errno %dn", errno);
return -1;
}
fcntl(sock,F_SETFD,FD_CLOEXEC);
......
cma___pre_exec_cleanup() (internal routine) sets the file-descriptors
to blocking mode.
A change in the code would involve calling set_blocking every time in
the accept() wrapper and that may lead to decreased performance. For
this reason we recommend close-on-exec as a documented workaround.
"
There is some excellent threads FAQs and manuals info at URL:
http://devresource.hp.com/
You must go there....there is some good detailed info.
I hope this helps.
"
There is a documented workaround for an accept()/system() call problem.
It is to use an fcntl call to set the close-on-exec flag before calling exec() (which select() is a thin wrapper for anyway; fork/exec/wait). This is documented in "Programming with Threads on HP-UX" in section 3.2.1.6 on page 3-16.
The other option would be to avoid using the select call and calling exec directly
rather than the exec wrapper, also documented in the same section.
The fcntl can be used soon after the socket is created.
.......
sock = socket(AF_INET,SOCK_STREAM, 0);
if (sock == -1) {
fprintf(stderr, "socket failed, errno %dn", errno);
return -1;
}
fcntl(sock,F_SETFD,FD_CLOEXEC);
......
cma___pre_exec_cleanup() (internal routine) sets the file-descriptors
to blocking mode.
A change in the code would involve calling set_blocking every time in
the accept() wrapper and that may lead to decreased performance. For
this reason we recommend close-on-exec as a documented workaround.
"
There is some excellent threads FAQs and manuals info at URL:
http://devresource.hp.com/
You must go there....there is some good detailed info.
I hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2000 01:01 AM
09-20-2000 01:01 AM
Re: Regarding HPUX10.2
Hi Peter,
Thanks for your suggestion about using fcntl(). Our program did work for the second accept(). It was very kind of you to give us this solution
Thank you
Soumya
Thanks for your suggestion about using fcntl(). Our program did work for the second accept(). It was very kind of you to give us this solution
Thank you
Soumya
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP