HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- pthreads_tr linking problem
Operating System - HP-UX
1833323
Members
3091
Online
110051
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
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
03-14-2002 08:32 AM
03-14-2002 08:32 AM
pthreads_tr linking problem
We are porting a dce application to kernel threads. Funny thing: the code behaves when we link to libpthread_tr.sl; it does not behave when we link to libpthread.sl. More specifically, it will not call the function specified in pthread_once (the first pthread call). Anyone experience anything similar and or have some advice?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2002 08:57 AM
03-14-2002 08:57 AM
Re: pthreads_tr linking problem
I've never used pthread_once, but my advise is to be careful that you are initialising the once_control object correctly:
static pthread_once_t once_control = PTHREAD_ONCE_INIT;
extern void initialize();
(void)pthread_once(&once_control, initialize);
Make sure multiple threads aren't using different once_control objects, and that they aren't re-initialising the same object before calling pthread_once. Ideally initialise the once_object before creating any threads.
Migrating to kernel threads will always expose those race conditions that you never knew you had :)
Regards,
Steve
static pthread_once_t once_control = PTHREAD_ONCE_INIT;
extern void initialize();
(void)pthread_once(&once_control, initialize);
Make sure multiple threads aren't using different once_control objects, and that they aren't re-initialising the same object before calling pthread_once. Ideally initialise the once_object before creating any threads.
Migrating to kernel threads will always expose those race conditions that you never knew you had :)
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2002 05:59 AM
03-15-2002 05:59 AM
Re: pthreads_tr linking problem
Thank you for the input Steve. I double-checked everything you recommended in your reply and still have the same results. The pthread_once function returns properly, but it does not cause the referenced function to be executed.
I am still confused by the program executing when the tracing version of the pthread library(libpthread_tr) is linked in and not executing with the normal version linked in. I suspect, but have not confirmed yet, that this problem is not restricted to the pthread_once call. It just happens to be the first pthread call made by our program.
I am still confused by the program executing when the tracing version of the pthread library(libpthread_tr) is linked in and not executing with the normal version linked in. I suspect, but have not confirmed yet, that this problem is not restricted to the pthread_once call. It just happens to be the first pthread call made by our program.
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 2025 Hewlett Packard Enterprise Development LP