- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- gethostbyaddr & multi-thread
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
05-26-2005 12:48 AM
05-26-2005 12:48 AM
gethostbyaddr & multi-thread
I want to know if gethostbyaddr (HPUX 11) is thread safe. If not, are there any other functions I can use?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2005 01:03 AM
05-26-2005 01:03 AM
Re: gethostbyaddr & multi-thread
libc threads -- Which calls are thread safe? Which are not?
RESOLUTION TEXT
Starting at 10.0, libc functions are safe for use in multi-threaded
applications.
Thus no problem
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2005 01:30 AM
05-26-2005 01:30 AM
Re: gethostbyaddr & multi-thread
---
In a multithreaded application, gethostent(), gethostbyaddr(), and gethostbyname() use thread-specific storage that is re-used in each call. The return value, struct hostent, should be unique for each thread and should be saved, if desired, before the thread makes the next gethost*() call.
For enumeration in multithreaded applications, the position within the enumeration is a process-wide property shared by all threads. sethostent() may be used in a multithreaded application, but resets the enumeration position for all threads. If multiple threads interleave calls to gethostent(), the threads will enumerate disjoint subsets of the host database.
---
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2005 04:28 AM
05-27-2005 04:28 AM
Re: gethostbyaddr & multi-thread
There are also small open-source bits out there that will allow you to use those routines on 11.00 or other platforms without a native getaddrinfo() call. I use one in the 2.4.0 version of netperf - http://www.netperf.org/
I suspect the native getnodeinfo on 11.11 and later is thread-safe. I'm not sure if the package I use to emulate those for 11.0 is or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2005 06:25 AM
06-03-2005 06:25 AM
Re: gethostbyaddr & multi-thread
Steve, if all libc functions are thread safe then why I see in page
http://docs.hp.com/en/B3921-90010/thread_safety.5.html there are still functions which are not thread-safe?
For example, setmntent is classfied in "Interfaces That Are Not thread-safe" category. I am quite concerned about this because I am using setmntent, getmntent and endmntent.