- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- gethostbyname thread safe?!
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
Forums
Discussions
Discussions
Discussions
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
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
06-01-2008 07:01 AM
06-01-2008 07:01 AM
I'm using the gethostbyname function in my code, which is compiled on different UNIXs (AIX,HP, Linux, Solaris, etc.)
I found in the web people that say that this function is thread safe on some OS versions (HPUX 11, AIX 5... )
I must confirm this issue, so...
1. I need to know if this function is a thread safe on HPUX and if so, what is the minmal version for this safety?!
2. I read in HP documentation (http://docs.hp.com/en/B3921-90010/thread_safety.5.html) - what is the meaning of "Cancel Safe"? since this function is under this criteria.
tx in advance,
Shlom
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2008 12:57 PM
06-01-2008 12:57 PM
Re: gethostbyname thread safe?!
HP-UX "11" is not a precise description of an
HP-UX version.
I know nothing, but, resorting to the
painfully obvious "man gethostbyname" on an
HP-UX 11.31 PA-RISC system, I pretty easily
found a section which begins:
In a multithreaded application, [...]
and which seems to provide all the
thread-related info _I_'d ever want.
If you don't have an HP-UX system where you
can do this, try:
http://www.testdrive.hp.com/
Systems are available back to HP-UX 11.11.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2008 09:22 PM
06-01-2008 09:22 PM
Re: gethostbyname thread safe?!
It means that if you use pthread_cancel, everything is predictable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2008 12:41 AM
06-02-2008 12:41 AM
Re: gethostbyname thread safe?!
1. Risc 11.23
2. Dennis, I didn't understand your answer - can you give more details please?! Actually, if you have some source that says that gethostbyname is thread safe on HPUX 11.23 (or not...) it would be better.
tx again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2008 05:38 AM
06-02-2008 05:38 AM
Re: gethostbyname thread safe?!
Your 11.11 document says it is thread safe. So does 11.23:
http://docs.hp.com/en/B3921-60631/thread_safety.5.html
>2. I didn't understand your answer - can you give more details please?
It is thread safe. It is also non-asynchronous cancel safe.
>if you have some source that says that gethostbyname is thread safe on HPUX 11.23
You have the source, thread_safety(5).
And as Steven said see "multithreaded application" in gethostent(3N).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2008 06:52 AM
06-02-2008 06:52 AM
Re: gethostbyname thread safe?!
tx again for giving me the answer - I understand now that this is a thread safe function.
Now, for my general info:
I still don't understand the meaning of "Cancel-Safe"...
If a function is Cancel-Safe one, so it's a ____________________________
shlom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2008 07:03 AM
06-02-2008 07:03 AM
SolutionSee pthread_cancel(3T):
http://docs.hp.com/en/B2355-60130/pthread_cancel.3T.html
It means the thread can be terminated in a controlled manner and doesn't leave resources lying around and possibly leave mutexes locked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2008 08:08 AM
06-02-2008 08:08 AM
Re: gethostbyname thread safe?!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2008 09:38 AM
06-02-2008 09:38 AM
Re: gethostbyname thread safe?!
Among other things, getaddrinfo() enables retrieval of IPv6 addresses and can make a few things easier even with IPv4 addresses. At least that was my impression after making the necessary modifications to the netperf benchmark sources.