bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: horrible disk thorughput on itanium


From: Padraig Brady
Subject: Re: horrible disk thorughput on itanium
Date: Fri, 07 Dec 2001 18:41:31 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120

Linus Torvalds wrote:

On Fri, 7 Dec 2001, Andi Kleen wrote:

Your proposals sound rather dangerous. They would silently break recompiled
threaded programs that need the locking and don't use -D__REENTRANT


No it wouldn't.

Once you do a pthread_create(), the locking is there.

Before you do a pthread_create(), it doesn't lock.


Hmm that could work. There are issues where getc etc are actually

macros if unlocked, so it wouldn't be clean, but that's beside the
point. Also there might be undesirable coupling between stdio and
the threads implementation but still it sounds like a great idea.

Padraig.


What's the problem? Before you do a pthread_create(), you don't _NEED_
locking, because there is only one thread that accesses the stdio data
structures.

And there are no races - if there is only one thread, then another thread
couldn't be suddenly doing a pthread_create() during a stdio operations.

Safe, and efficient. Yes, it adds a flag test or a indirect branch, but
considering that you avoid a serialized locking instruction, the
optimization sounds obvious.

                Linus






reply via email to

[Prev in Thread] Current Thread [Next in Thread]