apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Ince" <si...@opendemand.com>
Subject Re: apr threads priority and default memory pool allocation
Date Sat, 24 Jan 2004 23:16:58 GMT
I will answer my own question on 'setting thread priority' . It seems that
the apr  doesn't have a platform independent way to set the thread priority.
You have to get a handle to the implementation and set it accordingly.

Example.
#ifdef WIN32
#include <arch/win32/apr_arch_threadproc.h>
#endif
:
:
#ifdef WIN32
            SetThreadPriority( OpenloadPrintingThread->td,
THREAD_PRIORITY_ABOVE_NORMAL );
#elif APR_HAVE_PTHREAD_H
/* do the pthread version */
#endif

Steve
----- Original Message ----- 
From: "Sander Striker" <striker@apache.org>
To: "Stephen Ince" <since@opendemand.com>
Cc: <dev@apr.apache.org>; <ddoane@opendemand.com>
Sent: Friday, January 16, 2004 3:16 AM
Subject: Re: apr threads priority and default memory pool allocation


> On Fri, 2004-01-16 at 07:37, Stephen Ince wrote:
> > Hi,
> >     I am relatively new to the apr. I would like to the know
> > the following.
> >
> > 1) Is it possible to set the default memory allocation for a sub pool
> > or a pool? I looked at the code and I noticed that the minimum size is
> > 8k. This seems quite large.
> >
> > psuedo code:
> >    apr_pool_create(&sub_pool, pool);
> >     // Is the real memory for the sub_pool initialially being
> > allocated 8k,
>
> Yes.
>
> >  or does it use the
> >     // real memory that is allocated in the parent 'pool'?
>
> No, although we could probably code that up, with the sidenote
> that moving a child pool to a different parent is impossible
> to implement thereafter.
>
> >  Does it only request memory from
> >     // the system if the parent pool requires it.
>
> It only requests memory when the allocator associated with the
> pool requires it.  Parent and child pools don't neccessarily share
> the same allocator.
>
>
> Sander
>


Mime
View raw message