This is the mail archive of the
mailing list for the glibc project.
question about race:stream in glibc manual
- From: Ma Shimiao <shimiao dot ma at gmail dot com>
- To: libc-help at sourceware dot org
- Cc: mashimiao dot fnst at cn dot fujitsu dot com
- Date: Thu, 13 Nov 2014 23:34:36 +0800
- Subject: question about race:stream in glibc manual
- Authentication-results: sourceware.org; auth=none
I'm Ma Shimiao.
I'm a bit new to glibc.
I have a question about glibc manual, could you help me?
The glib manual says,
if a function annotated with race, it should operate on objects in ways that may cause
data races or similar forms of destructive interference out of concurrent execution.
In some cases, the objects are passed to the functions by users;
in others, they are used by the functions to return values to users;
in others, they are not even exposed to users.
We consider access to objects passed as (indirect) arguments to functions to be data
race free. The assurance of data race free objects is the callerâs responsibility. We
will not mark a function as MT-Unsafe or AS-Unsafe if it misbehaves when users fail
to take the measures required by POSIX to avoid data races when dealing with such
According to the manual, I think if a function has an argument FILE *stream and the stream
may cause data races inside the function, it should annotated with MT-Safe race:stream.
Am I right?