From: Peng Haitao <penght-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: pasky-AlSwsSmVLrQ@public.gmane.org,
linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: About thread-safety information in library functions' man-pages
Date: Tue, 31 Aug 2010 14:18:14 +0800 [thread overview]
Message-ID: <4C7C9EA6.90609@cn.fujitsu.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 918 bytes --]
Hi Michael and all,
When doing multithreaded programming, it is necessary to know the thread-safety
levels of the library functions. However, there is little thread-safety
information in current man-pages. And the lack of information often makes us
confused when programming in multithreaded environment.
If we could add information about functions' thread-safety levels based on
POSIX standard into man-pages, just like man-pages in Solaris, it will be
more helpful to programmers who are doing multithreaded programming with GLIBC.
For function whose thread-safety level is clear, I have made several patches
which contain detailed descriptions of the thread-safety levels. The attached
patches can be as samples. If necessary, I will gradually make more patches
to enhance thread-safety information in man-pages. So what do you think?
I am looking forward to your feedback soon!
--
Best Regards,
Peng Haitao
[-- Attachment #2: 0002-hsearch.3-Add-description-of-the-functions-are-not.patch --]
[-- Type: text/plain, Size: 1473 bytes --]
From 4463662ef2d9c94803dcdbe3290ad1969a07439b Mon Sep 17 00:00:00 2001
From: Peng Haitao <penght@cn.fujitsu.com>
Date: Tue, 31 Aug 2010 14:13:37 +0800
Subject: [PATCH] hsearch.3: Add description of the functions are not thread-safe
The three functions hcreate(), hdestroy() and hsearch() use a global space
for storing the table, so they are not thread-safe.
Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
---
man3/hsearch.3 | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/man3/hsearch.3 b/man3/hsearch.3
index b392b55..f902aae 100644
--- a/man3/hsearch.3
+++ b/man3/hsearch.3
@@ -32,7 +32,7 @@
.\" 2008-09-03, mtk, restructured somewhat, in part after suggestions from
.\" Timothy S. Nelson <wayland@wayland.id.au>
.\"
-.TH HSEARCH 3 2008-10-06 "GNU" "Linux Programmer's Manual"
+.TH HSEARCH 3 2010-08-31 "GNU" "Linux Programmer's Manual"
.SH NAME
hcreate, hdestroy, hsearch, hcreate_r, hdestroy_r,
hsearch_r \- hash table management
@@ -270,6 +270,13 @@ rather than creating a single table whose lifetime
matches that of the program),
then the program must maintain bookkeeping data structures that
allow it to free them.
+.PP
+The three functions
+.BR hcreate (),
+.BR hsearch ()
+and
+.BR hdestroy ()
+use a global space for storing the table, so they are not thread-safe.
.SH BUGS
SVr4 and POSIX.1-2001 specify that \fIaction\fP
is significant only for unsuccessful searches, so that an \fBENTER\fP
--
1.6.0.1
[-- Attachment #3: 0001-a64l.3-Add-description-of-the-function-is-not-threa.patch --]
[-- Type: text/plain, Size: 1030 bytes --]
From a66a5b7209897b92cf64755edd31b9c77eb7c1aa Mon Sep 17 00:00:00 2001
From: Peng Haitao <penght@cn.fujitsu.com>
Date: Tue, 31 Aug 2010 14:13:28 +0800
Subject: [PATCH] a64l.3: Add description of the function is not thread-safe
The function l64a() uses a static variable "result", so it is not thread-safe.
Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
---
man3/a64l.3 | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/man3/a64l.3 b/man3/a64l.3
index 0c10651..b14550d 100644
--- a/man3/a64l.3
+++ b/man3/a64l.3
@@ -3,7 +3,7 @@
.\"
.\" Corrected, aeb, 2002-05-30
.\"
-.TH A64L 3 2010-08-29 "" "Linux Programmer's Manual"
+.TH A64L 3 2010-08-31 "" "Linux Programmer's Manual"
.SH NAME
a64l, l64a \- convert between long and base-64
.SH SYNOPSIS
@@ -72,6 +72,10 @@ These functions are broken in glibc before 2.2.5
.LP
This is not the encoding used by
.BR uuencode (1).
+.LP
+The
+.BR l64a ()
+function is not thread-safe.
.SH "SEE ALSO"
.BR uuencode (1),
.\" .BR itoa (3),
--
1.6.0.1
next reply other threads:[~2010-08-31 6:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-31 6:18 Peng Haitao [this message]
[not found] ` <4C7C9EA6.90609-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2010-09-11 4:06 ` About thread-safety information in library functions' man-pages Michael Kerrisk
[not found] ` <AANLkTimcJ4kSuB-vZSY2_CYDs12S0ODup9-Y9yj-uQrJ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-13 9:19 ` Peng Haitao
[not found] ` <4C8DEC85.8030007-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2010-10-15 9:06 ` Peng Haitao
2010-11-14 6:40 ` Michael Kerrisk
[not found] ` <AANLkTikVuuZ1N6C5T+GwbgQEH7EAxXPvqrmATZgcM-gE-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-15 6:37 ` Peng Haitao
[not found] ` <4CE0D541.8030807-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2010-11-15 6:39 ` Michael Kerrisk
[not found] ` <AANLkTi=3MpbEeMksjqMtM81HjhCODVRR7Y9KDo=ivnSQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-15 7:15 ` Peng Haitao
[not found] ` <4CE0DE06.6020009-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2010-11-16 5:20 ` Michael Kerrisk
[not found] ` <AANLkTikfXyDz47VyRYMrGoAm_Qyv96PbGVnfY82KiSh_-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-17 9:06 ` Peng Haitao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C7C9EA6.90609@cn.fujitsu.com \
--to=penght-bthxqxjhjhxqfuhtdcdx3a@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=pasky-AlSwsSmVLrQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.