- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Shared libraries, threads and gethostbyname
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
01-22-2003 02:15 PM
01-22-2003 02:15 PM
Shared libraries, threads and gethostbyname
I'm trying to figure out why this code:
--------------------------------------
#include
#include
#include
extern "C"
{
void* test_thr(void* args)
{
cout << "-------------------------------" << endl;
cout << "Calling gethostbyname()" << endl;
hostent* host = gethostbyname("localhost");
cout << "host address is: " << host->h_name << endl;
cout << "errno is: " << errno << endl;
cout << "-------------------------------" << endl;
}
}
int do_test( void )
{
pthread_t tid;
pthread_create(&tid, NULL, test_thr, NULL);
pthread_join(tid, NULL);
}
--------------------------------------
Blocks on the gethostbyname() call when the above is put into a shared library and do_test() is called. Is there anything inherantly wrong with calling hostname lookup API's from the context of a thread created from a shared library that's been loaded into the main executable via shl_load()?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2003 01:33 PM
01-28-2003 01:33 PM
Re: Shared libraries, threads and gethostbyname
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2003 02:15 PM
01-28-2003 02:15 PM
Re: Shared libraries, threads and gethostbyname
I can't tell, but I think my application is getting into a situation like the attached archive. In this case, I've got a global object that in turns makes the "do_test()" call. In this case the gethostbyname() call blocks...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2003 02:16 PM
01-28-2003 02:16 PM
Re: Shared libraries, threads and gethostbyname
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2003 09:51 AM
01-29-2003 09:51 AM
Re: Shared libraries, threads and gethostbyname
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2003 09:55 AM
01-29-2003 09:55 AM