All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 1/1] pthread_detach.3: remove invalid and confusing statement
@ 2015-09-26  6:04 Rahul Bedarkar
       [not found] ` <1443247457-3507-1-git-send-email-rahulbedarkar89-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Rahul Bedarkar @ 2015-09-26  6:04 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, 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.

Signed-off-by: Rahul Bedarkar <rahulbedarkar89-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 man3/pthread_detach.3 | 2 --
 1 file changed, 2 deletions(-)

diff --git a/man3/pthread_detach.3 b/man3/pthread_detach.3
index 106914b..2c53409 100644
--- a/man3/pthread_detach.3
+++ b/man3/pthread_detach.3
@@ -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:
 
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH 1/1] pthread_detach.3: remove invalid and confusing statement
       [not found] ` <1443247457-3507-1-git-send-email-rahulbedarkar89-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-10-08 21:10   ` Michael Kerrisk (man-pages)
       [not found]     ` <5616DBB4.7060903-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-10-08 21:10 UTC (permalink / raw)
  To: Rahul Bedarkar
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	linux-man-u79uwXL29TY76Z2rM5mHXA

Rahul,

On 09/26/2015 07:04 AM, Rahul Bedarkar wrote:
> 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


> Signed-off-by: Rahul Bedarkar <rahulbedarkar89-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  man3/pthread_detach.3 | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/man3/pthread_detach.3 b/man3/pthread_detach.3
> index 106914b..2c53409 100644
> --- a/man3/pthread_detach.3
> +++ b/man3/pthread_detach.3
> @@ -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:
>  
> 


-- 
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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH 1/1] pthread_detach.3: remove invalid and confusing statement
       [not found]     ` <5616DBB4.7060903-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-10-13  3:48       ` Rahul Bedarkar
       [not found]         ` <CA+NV+Vmh7SHoqyToYbznHeO6qgr=c0dfw=4hnT5d0=VSNP5eNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Rahul Bedarkar @ 2015-10-13  3:48 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

On Fri, Oct 9, 2015 at 2:40 AM, Michael Kerrisk (man-pages)
<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Rahul,
>
> On 09/26/2015 07:04 AM, Rahul Bedarkar wrote:
>> 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?

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

>
> Thanks,
>
> Michael
>
>
>> Signed-off-by: Rahul Bedarkar <rahulbedarkar89-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>>  man3/pthread_detach.3 | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/man3/pthread_detach.3 b/man3/pthread_detach.3
>> index 106914b..2c53409 100644
>> --- a/man3/pthread_detach.3
>> +++ b/man3/pthread_detach.3
>> @@ -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:
>>
>>
>
>
> --
> 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH 1/1] pthread_detach.3: remove invalid and confusing statement
       [not found]         ` <CA+NV+Vmh7SHoqyToYbznHeO6qgr=c0dfw=4hnT5d0=VSNP5eNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-09-29 16:25           ` Michael Kerrisk (man-pages)
       [not found]             ` <CAKgNAkhK=dS=dREBdoo3ROwwQ3GXRH5C+dhtAW6GgdyA4mfUNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-09-29 16:25 UTC (permalink / raw)
  To: Rahul Bedarkar; +Cc: linux-man

Hello Rahul,

A> very late follow-up...

On 13 October 2015 at 05:48, Rahul Bedarkar <rpal143-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Fri, Oct 9, 2015 at 2:40 AM, Michael Kerrisk (man-pages)
> <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> Rahul,
>>
>> On 09/26/2015 07:04 AM, Rahul Bedarkar wrote:
>>> 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?
>
> 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.

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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH 1/1] pthread_detach.3: remove invalid and confusing statement
       [not found]             ` <CAKgNAkhK=dS=dREBdoo3ROwwQ3GXRH5C+dhtAW6GgdyA4mfUNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-10-10 13:30               ` Rahul Bedarkar
  0 siblings, 0 replies; 5+ messages in thread
From: Rahul Bedarkar @ 2017-10-10 13:30 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man

On Fri, Sep 29, 2017 at 9:55 PM, Michael Kerrisk (man-pages)
<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hello Rahul,
>
> A> very late follow-up...
>
> On 13 October 2015 at 05:48, Rahul Bedarkar <rpal143-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On Fri, Oct 9, 2015 at 2:40 AM, Michael Kerrisk (man-pages)
>> <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>> Rahul,
>>>
>>> On 09/26/2015 07:04 AM, Rahul Bedarkar wrote:
>>>> 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?
>>
>> 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.
>
> 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-10 13:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-26  6:04 [RFC PATCH 1/1] pthread_detach.3: remove invalid and confusing statement Rahul Bedarkar
     [not found] ` <1443247457-3507-1-git-send-email-rahulbedarkar89-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-08 21:10   ` Michael Kerrisk (man-pages)
     [not found]     ` <5616DBB4.7060903-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-13  3:48       ` Rahul Bedarkar
     [not found]         ` <CA+NV+Vmh7SHoqyToYbznHeO6qgr=c0dfw=4hnT5d0=VSNP5eNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-29 16:25           ` Michael Kerrisk (man-pages)
     [not found]             ` <CAKgNAkhK=dS=dREBdoo3ROwwQ3GXRH5C+dhtAW6GgdyA4mfUNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-10 13:30               ` Rahul Bedarkar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.