From dev-return-10867-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Fri Jan 09 11:29:08 2004 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 39927 invoked from network); 9 Jan 2004 11:29:07 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 9 Jan 2004 11:29:07 -0000 Received: (qmail 79960 invoked by uid 500); 9 Jan 2004 11:28:39 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 79926 invoked by uid 500); 9 Jan 2004 11:28:39 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Delivered-To: moderator for dev@apr.apache.org Received: (qmail 65782 invoked from network); 9 Jan 2004 02:55:37 -0000 Message-ID: <3FFE1839.7010106@opendemand.com> Date: Thu, 08 Jan 2004 21:55:53 -0500 From: Donald Doane Reply-To: ddoane@opendemand.com Organization: OpenDemand Systems, Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Cliff Woolley CC: test-dev@httpd.apache.org, dev@apr.apache.org Subject: Re: apr_psprintf thread safe? References: <3FF5E73F.7090104@stason.org> <3FF6FCF9.9060207@modperlcookbook.org> <3FFD98C4.1030506@opendemand.com> <3FFD9EFA.8030508@modperlcookbook.org> <3FFDA491.4070808@opendemand.com> Content-Type: multipart/alternative; boundary="------------080101090600060802070906" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --------------080101090600060802070906 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit The following comment is from apr_lib.h: * apr_vformatter does not call out to any other code, it is entirely * self-contained. This allows the callers to do things which are * otherwise "unsafe". For example, apr_psprintf uses the "scratch" * space at the unallocated end of a block, and doesn't actually * complete the allocation until apr_vformatter returns. apr_psprintf * would be completely broken if apr_vformatter were to call anything * that used a apr_pool_t. Similarly http_bprintf() uses the "scratch" * space at the end of its output buffer, and doesn't actually note * that the space is in use until it either has to flush the buffer * or until apr_vformatter returns. Cliff Woolley wrote: >Where does it say that? httpd uses it extensively, so if it's not, I'd >tend to think we'd have noticed by now... > >--Cliff > > >On Thu, 8 Jan 2004, Donald Doane wrote: > > > >>Okay, will do that, but it's called in >>"flood_easy_reports::easy_process_stats()" and it seems APR >>documentation implies it is not thread safe. >> >>We use a modified version of "flood_easy_reports" and I'd like to >>confirm whether or not its use is truly thread safe. >> >>Geoffrey Young wrote: >> >> >> >>>Donald Doane wrote: >>> >>> >>> >>> >>>>Can someone please confirm whether or not "apr_psprintf" is thread safe. >>>> >>>>Thank you. >>>> >>>> >>>> >>>> >>>sorry, wrong list. try dev@apr.apache.org. >>> >>>--Geoff >>> >>> >>> >>> >>> >>> >> >> > > > --------------080101090600060802070906 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit The following comment is from apr_lib.h:

 * apr_vformatter does not call out to any other code, it is entirely
 * self-contained.  This allows the callers to do things which are
 * otherwise "unsafe".  For example, apr_psprintf uses the "scratch"
 * space at the unallocated end of a block, and doesn't actually
 * complete the allocation until apr_vformatter returns.  apr_psprintf
 * would be completely broken if apr_vformatter were to call anything
 * that used a apr_pool_t.  Similarly http_bprintf() uses the "scratch"
 * space at the end of its output buffer, and doesn't actually note
 * that the space is in use until it either has to flush the buffer
 * or until apr_vformatter returns.

Cliff Woolley wrote:
Where does it say that?  httpd uses it extensively, so if it's not, I'd
tend to think we'd have noticed by now...

--Cliff


On Thu, 8 Jan 2004, Donald Doane wrote:

  
Okay, will do that, but it's called in
"flood_easy_reports::easy_process_stats()" and it seems APR
documentation implies it is not thread safe.

We use a modified version of "flood_easy_reports" and I'd like to
confirm whether or not its use is truly thread safe.

Geoffrey Young wrote:

    
Donald Doane wrote:


      
Can someone please confirm whether or not "apr_psprintf" is thread safe.

Thank you.


        
sorry, wrong list.  try dev@apr.apache.org.

--Geoff




      
    

  

--------------080101090600060802070906--