[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: threading question?
From: |
Andreas Jaeger |
Subject: |
Re: threading question? |
Date: |
Fri, 10 Aug 2001 21:33:43 +0200 |
User-agent: |
Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.4 (Academic Rigor) |
Roger Davenport <address@hidden> writes:
> Hi,
>
> This isn't really a bug, but I am wondering if glibc functions like
> sprintf, printf, etc are all pthread locking? (when used with
> LinuxThreads 0.9) I can understand the need (for instance, printf needs
> to lock on stdout) but wonder if there is a way to disable it for
> programs that are smart enough to handle their own locking.
>
> I ran a gprof on my code and noticed that sprintf was locking like a
> horse, even though the target buffer was static to the thread. I don't
> know if gcc/glibc is smart enough to understand statics in threads, but
> my guess is no.
Check __fsetlocking as part of <stdio-ext.h>, it should be documented
in the libc manual,
Andreas
--
Andreas Jaeger
SuSE Labs address@hidden
private address@hidden
http://www.suse.de/~aj