Skip to contentSkip to conversation

pthread_detach.3: remove invalid and confusing statement

RFC PATCH In review Rahul Bedarkar 3 participants 5 messages Sep 26, 2015 – Oct 10, 2017 4 messages not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 pthread_detach.3: remove invalid and confusing statement

In notes section, statement

"(But note that the resources of all threads are freed when the process terminates.)"

is confusing and invalid. In Linux, we don't really need to wait until application termination for system resources to be freed unless there is bug in application logic.

---
 man3/pthread_detach.3 | 2 --
 1 file changed, 2 deletions(-)
man3/pthread_detach.3 +0 -2
index 106914b..2c53409 100644
@@ -101,8 +101,6 @@ or
 .BR pthread_detach ()
 should be called for each thread that an application creates,
 so that system resources for the thread can be released.
-(But note that the resources of all threads are freed when the
-process terminates.)
 .SH EXAMPLE
 The following statement detaches the calling thread:
 
Signature · 6 lines
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to a message not in the archive

Rahul,

Quoted 8 lines · Rahul Bedarkar

In notes section, statement

"(But note that the resources of all threads are freed when the process terminates.)"

is confusing and invalid. In Linux, we don't really need to wait until application termination for system resources to be freed unless there is bug in application logic.

While I'm not sure that that sentence is essential, it does serve to remind the reader that all resources are freed on process termination, regardless of whether pthread_detach() and pthread_join() are used.

It's not clear to me why you find it confusing or invalid. Can you say more?

Thanks,

Michael

Quoted 19 lines
---
 man3/pthread_detach.3 | 2 --
 1 file changed, 2 deletions(-)
man3/pthread_detach.3 +0 -2
index 106914b..2c53409 100644
@@ -101,8 +101,6 @@ or
 .BR pthread_detach ()
 should be called for each thread that an application creates,
 so that system resources for the thread can be released.
-(But note that the resources of all threads are freed when the
-process terminates.)
 .SH EXAMPLE
 The following statement detaches the calling thread:
 
Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
In reply to a message not in the archive
Quoted 12 lines · Michael Kerrisk (man-pages)

Rahul,

Quoted 8 lines · Rahul Bedarkar

In notes section, statement

"(But note that the resources of all threads are freed when the process terminates.)"

is confusing and invalid. In Linux, we don't really need to wait until application termination for system resources to be freed unless there is bug in application logic.

Quoted 7 lines

While I'm not sure that that sentence is essential, it does serve to remind the reader that all resources are freed on process termination, regardless of whether pthread_detach() and pthread_join() are used.

It's not clear to me why you find it confusing or invalid. Can you say more?

Hi Michael,

Why it should be a special case about pthread that we should mention that all resources are freed on process termination which is feature of an Operating system.

When we don't mention it in open.2 or free.3, I thought it should not be mentioned in pthread case, as it is something not related to it.

The sentence in bracket looks more confusing if we read previous one.

"Either pthread_join(3) or pthread_detach() should be called for each thread that an application creates, so that system resources for the thread can be released. (But note that the resources of all threads are freed when the process terminates.)"

I think above sentences convey that you should call either pthread_join() or pthread_detach() so that resources are can be freed. But note that those won't get freed until process is terminated.

That's why it looks confusing to me and looks invalid because note in bracket conveys different meaning than intended.

Regards,
Rahul

Quoted 23 lines

Thanks,

Michael

Quoted 17 lines
---
 man3/pthread_detach.3 | 2 --
 1 file changed, 2 deletions(-)
man3/pthread_detach.3 +0 -2
index 106914b..2c53409 100644
@@ -101,8 +101,6 @@ or
 .BR pthread_detach ()
 should be called for each thread that an application creates,
 so that system resources for the thread can be released.
-(But note that the resources of all threads are freed when the
-process terminates.)
 .SH EXAMPLE
 The following statement detaches the calling thread:
Quoted 8 lines
Quoted 2 lines

--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
In reply to a message not in the archive

Hello Rahul,

A> very late follow-up...

Quoted 38 lines · Rahul Bedarkar
Quoted 12 lines · Michael Kerrisk (man-pages)

Rahul,

Quoted 8 lines · Rahul Bedarkar

In notes section, statement

"(But note that the resources of all threads are freed when the process terminates.)"

is confusing and invalid. In Linux, we don't really need to wait until application termination for system resources to be freed unless there is bug in application logic.

Quoted 7 lines

While I'm not sure that that sentence is essential, it does serve to remind the reader that all resources are freed on process termination, regardless of whether pthread_detach() and pthread_join() are used.

It's not clear to me why you find it confusing or invalid. Can you say more?

Hi Michael,

Why it should be a special case about pthread that we should mention that all resources are freed on process termination which is feature of an Operating system.

When we don't mention it in open.2 or free.3, I thought it should not be mentioned in pthread case, as it is something not related to it.

The sentence in bracket looks more confusing if we read previous one.

"Either pthread_join(3) or pthread_detach() should be called for each thread that an application creates, so that system resources for the thread can be released. (But note that the resources of all threads are freed when the process terminates.)"

Quoted 6 lines

I think above sentences convey that you should call either pthread_join() or pthread_detach() so that resources are can be freed. But note that those won't get freed until process is terminated.

That's why it looks confusing to me and looks invalid because note in bracket conveys different meaning than intended.

So, I changed that last sentence to try to eliminate such an ambiguity:

Either pthread_join(3) or pthread_detach() should be called for each thread that an application creates, so that system resources for the thread can be released. (But note that the resources of any threads for which one of these actions has not been done will be freed when the process terminates.)

Cheers,

Michael
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
In reply to a message not in the archive
Quoted 50 lines · Michael Kerrisk (man-pages)

Hello Rahul,

A> very late follow-up...

Quoted 38 lines · Rahul Bedarkar
Quoted 12 lines · Michael Kerrisk (man-pages)

Rahul,

Quoted 8 lines · Rahul Bedarkar

In notes section, statement

"(But note that the resources of all threads are freed when the process terminates.)"

is confusing and invalid. In Linux, we don't really need to wait until application termination for system resources to be freed unless there is bug in application logic.

Quoted 7 lines

While I'm not sure that that sentence is essential, it does serve to remind the reader that all resources are freed on process termination, regardless of whether pthread_detach() and pthread_join() are used.

It's not clear to me why you find it confusing or invalid. Can you say more?

Hi Michael,

Why it should be a special case about pthread that we should mention that all resources are freed on process termination which is feature of an Operating system.

When we don't mention it in open.2 or free.3, I thought it should not be mentioned in pthread case, as it is something not related to it.

The sentence in bracket looks more confusing if we read previous one.

"Either pthread_join(3) or pthread_detach() should be called for each thread that an application creates, so that system resources for the thread can be released. (But note that the resources of all threads are freed when the process terminates.)"

Quoted 6 lines

I think above sentences convey that you should call either pthread_join() or pthread_detach() so that resources are can be freed. But note that those won't get freed until process is terminated.

That's why it looks confusing to me and looks invalid because note in bracket conveys different meaning than intended.

Quoted 8 lines

So, I changed that last sentence to try to eliminate such an ambiguity:

Either pthread_join(3) or pthread_detach() should be called for each thread that an application creates, so that system resources for the thread can be released. (But note that the resources of any threads for which one of these actions has not been done will be freed when the process terminates.)

Thanks for fixing this. It is indeed very clear now.

Regards,
Rahul
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html