- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: pthread_detach question
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
Discussions
Discussions
Forums
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
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
тАО09-01-2004 09:12 AM
тАО09-01-2004 09:12 AM
pthread_detach question
This is my test program:
#define _MULTI_THREADED
#include
#include
#include
void *threadfunc(void *threadid)
{
void *status;
printf("In thread\n");
sleep(10);
printf("Exit thread\n");
pthread_exit(&status);
}
main()
{
pthread_t thread;
int rc, i;
printf("Start main()\n");
for (i = 0; i < 2; i++) {
rc = pthread_create(&thread, NULL, threadfunc, NULL);
printf("pthread_create returned %d\n", rc);
rc = pthread_detach(thread);
printf("pthread_detach returned %d\n", rc);
sleep(30);
}
printf("exit program\n");
exit(0);
}
- Tags:
- pthread
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-05-2004 08:39 AM
тАО09-05-2004 08:39 AM
Re: pthread_detach question
It is printf() per thread buffer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2004 03:33 AM
тАО09-08-2004 03:33 AM
Re: pthread_detach question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2004 07:03 AM
тАО09-08-2004 07:03 AM
Re: pthread_detach question
Each of the allocated stack address ranges was eventually reused. The stack of the most recently exited thread was not reused in the subsequent call to pthread_create.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2004 09:09 AM
тАО09-11-2004 09:09 AM