Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 36183 invoked by uid 500); 16 Apr 2003 06:48:49 -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 Received: (qmail 36132 invoked from network); 16 Apr 2003 06:48:48 -0000 Message-ID: <3E9CFCDA.3040400@dbaudio.com> Date: Wed, 16 Apr 2003 08:48:58 +0200 From: Gunter Coelle User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030116 X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@apr.apache.org Subject: Iterating with apr_hash_first / memory probs X-MIMETrack: Itemize by SMTP Server on notesde/Dbaudio(Release 5.0.6a |January 17, 2001) at 04/16/2003 08:48:59 AM, Serialize by Router on notesde/Dbaudio(Release 5.0.6a |January 17, 2001) at 04/16/2003 08:49:00 AM, Serialize complete at 04/16/2003 08:49:00 AM Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, I'd like to iterate over a hash table with apr_hash_first/this/next When I get it right I can use "apr_hash_first(NULL, ht)" to take a built in iterator. Fine so far. But since I have to iterate the hash table within two independant threads, i have to use "apr_hash_first (p, ht)" to allocate a new (independant) iterator. This takes up memory on every call to apr_hash_first, and since my threads have to iterates through the table permanently, this leads to memory shortage after a while. My opinion is, that the process of allocating an iterator (which can be done only once) and jumping to the first entry should be separated. Can you give some suggestions/solutions? Gunter